Lee-W commented on code in PR #60204:
URL: https://github.com/apache/airflow/pull/60204#discussion_r2690757833
##########
airflow-core/src/airflow/serialization/helpers.py:
##########
@@ -133,3 +134,29 @@ def find_registered_custom_timetable(importable_string:
str) -> type[CoreTimetab
def is_core_timetable_import_path(importable_string: str) -> bool:
"""Whether an importable string points to a core timetable class."""
return importable_string.startswith("airflow.timetables.")
+
+
+class PartitionMapperNotFound(ValueError):
+ """Raise when a PartitionMapper cannot be found."""
+
+ def __init__(self, type_string: str) -> None:
+ self.type_string = type_string
+
+ def __str__(self) -> str:
+ return (
+ f"PartitionMapper class {self.type_string!r} could not be imported
or "
+ "you have a top level database access that disrupted the session. "
+ "Please check the airflow best practices documentation."
+ )
+
+
+def is_core_partition_mapper_import_path(importable_string: str) -> bool:
+ """Whether an importable string points to a core partition mapper class."""
+ return importable_string.startswith("airflow.timetables.")
Review Comment:
I also feel it's better this way. `airflow.partition_mapper` maybe?
--
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]