dstandish commented on code in PR #45318:
URL: https://github.com/apache/airflow/pull/45318#discussion_r1904489152
##########
airflow/dag_processing/bundles/manager.py:
##########
@@ -90,7 +94,22 @@ def get_bundle(self, name: str, version: str | None = None)
-> BaseDagBundle:
:return: The DAG bundle.
"""
- # TODO: proper validation of the bundle configuration so we have
better error messages
- bundle_config = self.bundle_configs[name]
- bundle_class = import_string(bundle_config["classpath"])
- return bundle_class(name=name, version=version,
**bundle_config["kwargs"])
+ # todo (AIP-66): proper validation of the bundle configuration so we
have better error messages
+ cfg_tuple = _bundle_config.get(name)
+ if not cfg_tuple:
+ self.parse_config()
+ cfg_tuple = _bundle_config.get(name)
+ if not cfg_tuple:
+ raise ValueError(f"Requested bundle '{name}' is not
configured.")
Review Comment:
The thing is, you are calling `parse_config` unnecessarily when the bundle
is already there. There's a bunch of logic in parse config and it's sorta
wasteful to call it when the config you are looking for is already there.
That's partly the point of caching the configured bundles i think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]