2929 # We may not have kfp-tekton available and that's okay!
3030 TektonClient = None
3131
32+ try :
33+ from kfp import compiler # noqa
34+ except ImportError :
35+ # KFP python package is not installed
36+ compiler = None
37+
38+ try :
39+ # Check to see if Airflow package is installed, since we do not have any dependencies
40+ # on any Airflow package, we use GitHub as our canary
41+ from github import Github # noqa
42+ except ImportError :
43+ # Github package is not installed, we use GitHub as our default DAG repository
44+ Github = None
45+
3246from elyra .metadata .schema import SchemasProvider
3347from elyra .metadata .schemaspaces import CodeSnippets
3448from elyra .metadata .schemaspaces import ComponentCatalogs
@@ -51,7 +65,7 @@ class ElyraSchemasProvider(SchemasProvider, metaclass=ABCMeta):
5165 schema_json = json .load (f )
5266 local_schemas .append (schema_json )
5367
54- def __init__ (self ):
68+ def __init__ (self , * args , ** kwargs ):
5569 self .log = log .get_logger ()
5670 # get set of registered runtimes
5771 self ._runtime_processor_names = set ()
@@ -82,17 +96,17 @@ def get_schemas(self) -> List[Dict]:
8296 schemas = self .get_local_schemas_by_schemaspace (Runtimes .RUNTIMES_SCHEMASPACE_ID )
8397 for schema in schemas :
8498 if schema ["name" ] in self ._runtime_processor_names :
85- runtime_schemas .append (schema )
86- if schema ["name" ] == "kfp" :
99+ if schema ["name" ] == "kfp" and compiler :
87100 kfp_schema_present = True
88- elif schema ["name" ] == "airflow" :
101+ runtime_schemas .append (schema )
102+ elif schema ["name" ] == "airflow" and Github :
89103 airflow_schema_present = True
104+ runtime_schemas .append (schema )
90105 else :
91106 self .log .error (
92107 f"No entrypoint with name '{ schema ['name' ]} ' was found in group "
93108 f"'elyra.pipeline.processor' to match the schema with the same name. Skipping..."
94109 )
95-
96110 if kfp_schema_present : # Update the kfp engine enum to reflect current packages...
97111 # If TektonClient package is missing, navigate to the engine property
98112 # and remove 'tekton' entry if present and return updated result.
0 commit comments