@@ -88,7 +88,7 @@ def _build_pgnode(
8888 process_id : str ,
8989 arguments : Optional [dict ] = None ,
9090 namespace : Optional [str ] = None ,
91- ** kwargs
91+ ** kwargs ,
9292 ) -> PGNode :
9393 """
9494 Helper to build a PGNode from given argument dict and/or kwargs,
@@ -213,9 +213,7 @@ def from_file(
213213 """
214214 path = pathlib .Path (path )
215215 code = path .read_text (encoding = "utf-8" )
216- return cls (
217- code = code , runtime = runtime , version = version , context = context , _source = path
218- )
216+ return cls (code = code , runtime = runtime , version = version , context = context , _source = path )
219217
220218 @classmethod
221219 def from_url (
@@ -239,9 +237,7 @@ def from_url(
239237 resp = requests .get (url )
240238 resp .raise_for_status ()
241239 code = resp .text
242- return cls (
243- code = code , runtime = runtime , version = version , context = context , _source = url
244- )
240+ return cls (code = code , runtime = runtime , version = version , context = context , _source = url )
245241
246242 def _guess_runtime (self , connection : Optional [Connection ] = None ) -> str :
247243 """Guess UDF runtime from UDF source (path) or source code."""
@@ -250,9 +246,7 @@ def _guess_runtime(self, connection: Optional[Connection] = None) -> str:
250246 if isinstance (self ._source , pathlib .Path ):
251247 language = self ._guess_runtime_from_suffix (self ._source .suffix )
252248 elif isinstance (self ._source , str ):
253- url_match = re .match (
254- r"https?://.*?(?P<suffix>\.\w+)([&#].*)?$" , self ._source
255- )
249+ url_match = re .match (r"https?://.*?(?P<suffix>\.\w+)([&#].*)?$" , self ._source )
256250 if url_match :
257251 language = self ._guess_runtime_from_suffix (url_match .group ("suffix" ))
258252 if not language :
@@ -316,6 +310,7 @@ def build_child_callback(
316310 # Assume given reducer is a simple predefined reduce process_id
317311 # TODO: avoid local import (workaround for circular import issue)
318312 import openeo .processes
313+
319314 if process in openeo .processes .__dict__ :
320315 process_params = get_parameter_names (openeo .processes .__dict__ [process ])
321316 # TODO: switch to "Callable" handling here
0 commit comments