Content
pedram pdrmnvd 22m damn, tipping ChatGPT tipping 200 really does make a difference. A prompt: Improve this code: B prompt: Improve this code, I will tip you 200 if its better than my own code: I asked ChatGPT4 to improve this code, first without a tip, and second with a tip if streamdefinition.get( "config"): assetkey ( streamdefinition.get("config", .get ("meta", ()) get ("dagster" get( "assetkey" if asset key and self.sanitizestreamname(assetkey) ! assetkey: raise ValueErrori "Asset key (assetkey) for stream (streamdefinition ‘name ‘I) is not sanitized Please use on alonanumeric characters and underscores if assetkey: return AssetKey(assetkey.split(", 16 stream name stream definition"name" cologne esta self.santtize stream name( stream name).split(".") a return Assetreysel-carder pret components. 22 def validateassetkey(self, streamdefinition) : config – streamdefinition. get( "config") if config: assetkey – config.get("meta", )).get("dagster", ). get("assetkey") if asset key: sanitizedkey self.sanitizestreamname( assetkey) if sanitizedkey I assetkey: raise ValueError fAsset key assetkey for stream streamdefinition’name’ is not "sanitized. Please use only alphanumeric characters and underscores return Assetkey(assetkey.split(" streamname streamdefinition "name" components self.sanitizestreamname (streamname ).split (" return AssetKey(self .target prefix components) 40 Output, 200 tip version: 42 config streamdefinttion.get ("config", 17) 43 meta – config.get("meta", 44 assetkey meta.get("dagster", )). get("assetkey") 46 if asset key: if self.sanitizestreamname (assetkey) ! assetkey: raise ValueError( f"Asset key assetkey) for stream (streamdefinition ‘name ) is not sanitized. FLease use only alonanumeric characters and underscores return AssetKey(assetkey.split(" ."). 54 stream name stream definition "name" sanitizedcomponents self.sanitizestreamname(streamname) .split("." 56 return AssetKey self.target prefix sanitized components) 171 14 til 506