@@ -16,11 +16,21 @@ def create_airflow_dependency(table, partition_column):
16
16
Returns:
17
17
A dictionary with name and spec for the Airflow dependency
18
18
"""
19
- # Default partition column to 'ds' if not specified
20
- partition_col = partition_column or 'ds'
19
+ assert partition_column is not None , """Partition column must be provided via the spark.chronon.partition.column
20
+ config. This can be set as a default in teams.py, or at the individual config level. For example:
21
+ ```
22
+ Team(
23
+ conf=ConfigProperties(
24
+ common={
25
+ "spark.chronon.partition.column": "_test_column",
26
+ }
27
+ )
28
+ )
29
+ ```
30
+ """
21
31
return {
22
32
"name" : f"wf_{ utils .sanitize (table )} " ,
23
- "spec" : f"{ table } /{ partition_col } ={{{{ ds }}}}" ,
33
+ "spec" : f"{ table } /{ partition_column } ={{{{ ds }}}}" ,
24
34
}
25
35
26
36
def _get_partition_col_from_query (query ):
@@ -53,10 +63,8 @@ def _get_airflow_deps_from_source(source, partition_column=None):
53
63
tables .append (source .entities .mutationTable )
54
64
source_partition_column = _get_partition_col_from_query (source .entities .query ) or partition_column
55
65
elif source .joinSource :
56
- namespace = source .joinSource .join .metaData .outputNamespace
57
- table = utils .sanitize (source .joinSource .join .metaData .name )
58
- tables = [f"{ namespace } .{ table } " ]
59
- source_partition_column = _get_partition_col_from_query (source .joinSource .query ) or partition_column
66
+ # TODO: Handle joinSource -- it doesn't work right now because the metadata isn't set on joinSource at this point
67
+ return []
60
68
else :
61
69
# Unknown source type
62
70
return []
@@ -65,7 +73,7 @@ def _get_airflow_deps_from_source(source, partition_column=None):
65
73
66
74
67
75
def extract_default_partition_column (obj ):
68
- return obj .metaData .executionInfo .env .common .get ("partitionColumn " )
76
+ return obj .metaData .executionInfo .conf .common .get ("spark.chronon.partition.column " )
69
77
70
78
71
79
def _set_join_deps (join ):
0 commit comments