fabricks 3.0.15__py3-none-any.whl → 3.0.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fabricks/core/masks.py +8 -5
- fabricks/core/udfs.py +1 -1
- fabricks/deploy/__init__.py +4 -4
- fabricks/deploy/masks.py +2 -2
- fabricks/deploy/tables.py +3 -3
- {fabricks-3.0.15.dist-info → fabricks-3.0.16.dist-info}/METADATA +1 -1
- {fabricks-3.0.15.dist-info → fabricks-3.0.16.dist-info}/RECORD +8 -8
- {fabricks-3.0.15.dist-info → fabricks-3.0.16.dist-info}/WHEEL +0 -0
fabricks/core/masks.py
CHANGED
|
@@ -7,7 +7,7 @@ from fabricks.context import CATALOG, PATH_MASKS, SPARK
|
|
|
7
7
|
from fabricks.context.log import DEFAULT_LOGGER
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def register_all_masks():
|
|
10
|
+
def register_all_masks(override: bool = False):
|
|
11
11
|
"""
|
|
12
12
|
Register all masks.
|
|
13
13
|
"""
|
|
@@ -16,7 +16,7 @@ def register_all_masks():
|
|
|
16
16
|
for mask in get_masks():
|
|
17
17
|
split = mask.split(".")
|
|
18
18
|
try:
|
|
19
|
-
register_mask(mask=split[0])
|
|
19
|
+
register_mask(mask=split[0], override=override)
|
|
20
20
|
except Exception as e:
|
|
21
21
|
DEFAULT_LOGGER.exception(f"could not register mask {mask}", exc_info=e)
|
|
22
22
|
|
|
@@ -40,13 +40,16 @@ def is_registered(mask: str, spark: Optional[SparkSession] = None) -> bool:
|
|
|
40
40
|
return not df.isEmpty()
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def register_mask(mask: str, spark: Optional[SparkSession] = None):
|
|
43
|
+
def register_mask(mask: str, override: Optional[bool] = False, spark: Optional[SparkSession] = None):
|
|
44
44
|
if spark is None:
|
|
45
45
|
spark = SPARK
|
|
46
46
|
assert spark is not None
|
|
47
47
|
|
|
48
|
-
if not is_registered(mask, spark):
|
|
49
|
-
|
|
48
|
+
if not is_registered(mask, spark) or override:
|
|
49
|
+
if override:
|
|
50
|
+
DEFAULT_LOGGER.debug(f"override mask {mask}")
|
|
51
|
+
else:
|
|
52
|
+
DEFAULT_LOGGER.debug(f"register mask {mask}")
|
|
50
53
|
|
|
51
54
|
path = PATH_MASKS.joinpath(f"{mask}.sql")
|
|
52
55
|
spark.sql(path.get_sql())
|
fabricks/core/udfs.py
CHANGED
|
@@ -60,8 +60,8 @@ def is_registered(udf: str, spark: Optional[SparkSession] = None) -> bool:
|
|
|
60
60
|
def register_udf(
|
|
61
61
|
udf: str,
|
|
62
62
|
extension: Optional[str] = None,
|
|
63
|
+
override: Optional[bool] = False,
|
|
63
64
|
spark: Optional[SparkSession] = None,
|
|
64
|
-
override: bool = False,
|
|
65
65
|
):
|
|
66
66
|
"""
|
|
67
67
|
Register a user-defined function (UDF).
|
fabricks/deploy/__init__.py
CHANGED
|
@@ -25,12 +25,12 @@ class Deploy:
|
|
|
25
25
|
deploy_views()
|
|
26
26
|
|
|
27
27
|
@staticmethod
|
|
28
|
-
def udfs():
|
|
29
|
-
deploy_udfs()
|
|
28
|
+
def udfs(override: bool = True):
|
|
29
|
+
deploy_udfs(override=override)
|
|
30
30
|
|
|
31
31
|
@staticmethod
|
|
32
|
-
def masks():
|
|
33
|
-
deploy_masks()
|
|
32
|
+
def masks(override: bool = True):
|
|
33
|
+
deploy_masks(override=override)
|
|
34
34
|
|
|
35
35
|
@staticmethod
|
|
36
36
|
def notebooks():
|
fabricks/deploy/masks.py
CHANGED
|
@@ -2,7 +2,7 @@ from fabricks.context.log import DEFAULT_LOGGER
|
|
|
2
2
|
from fabricks.core.masks import register_all_masks
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
def deploy_masks():
|
|
5
|
+
def deploy_masks(override: bool = True):
|
|
6
6
|
DEFAULT_LOGGER.info("create or replace masks")
|
|
7
7
|
|
|
8
|
-
register_all_masks()
|
|
8
|
+
register_all_masks(override=override)
|
fabricks/deploy/tables.py
CHANGED
|
@@ -9,9 +9,9 @@ from fabricks.metastore.table import Table
|
|
|
9
9
|
def deploy_tables(drop: bool = False):
|
|
10
10
|
DEFAULT_LOGGER.info("create or replace fabricks (default) tables")
|
|
11
11
|
|
|
12
|
-
create_table_log(drop)
|
|
13
|
-
create_table_dummy(drop)
|
|
14
|
-
create_table_step(drop)
|
|
12
|
+
create_table_log(drop=drop)
|
|
13
|
+
create_table_dummy(drop=drop)
|
|
14
|
+
create_table_step(drop=drop)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def create_table_step(drop: bool = False):
|
|
@@ -79,8 +79,8 @@ fabricks/context/utils.py,sha256=EQRscdUhdjwk2htZu8gCgNZ9PfRzzrR6e1kRrIbVlBM,278
|
|
|
79
79
|
fabricks/core/__init__.py,sha256=LaqDi4xuyHAoLOvS44PQdZdRfq9SmVr7mB6BDHyxYpc,209
|
|
80
80
|
fabricks/core/extenders.py,sha256=oJzfv0hWxusnGmrjMwbrGyKfot8xzA4XtNquPWfFgPo,727
|
|
81
81
|
fabricks/core/job_schema.py,sha256=6-70oy0ZJd3V9AiXfc0Q8b8NVEynxQza_h7mB13uB-s,853
|
|
82
|
-
fabricks/core/masks.py,sha256=
|
|
83
|
-
fabricks/core/udfs.py,sha256=
|
|
82
|
+
fabricks/core/masks.py,sha256=0ARgXE6stazRlfjE2v2sOdQWjAH2TbCOgtuD33BeZqE,1531
|
|
83
|
+
fabricks/core/udfs.py,sha256=QlFOgN-Ceiv601-2O2sPXfSMqYYZiL29GvUkTfx_P0k,3163
|
|
84
84
|
fabricks/core/views.py,sha256=52tekqeP0Xk5EPYO220YdfFbzItX6NnObROb-ye9COQ,1181
|
|
85
85
|
fabricks/core/dags/__init__.py,sha256=0DUKzVcXcROvxkN19P_kaOJ7da5BAM7Vt8EGQbp2KSY,240
|
|
86
86
|
fabricks/core/dags/base.py,sha256=tFj27SqeZUZ7pB_LOWkpdowZz5gj30JUANI4gWK3Pl8,3139
|
|
@@ -129,11 +129,11 @@ fabricks/core/steps/_types.py,sha256=VxIrH3nFwmPlwG-UI8sDDP0AwK_9jlsy6yQp6YfgtqE
|
|
|
129
129
|
fabricks/core/steps/base.py,sha256=MJe2q9s1siM89YkpHDqldtbtKQgkhDB_cFa2-e_irvs,14642
|
|
130
130
|
fabricks/core/steps/get_step.py,sha256=8q4rEDdTTZNJsXB2l5XY-Ktoow8ZHsON_tx5yKMUIzg,284
|
|
131
131
|
fabricks/core/steps/get_step_conf.py,sha256=UPT3gB1Sh5yzawZ9qiVQlvVAKaxPX82gaWBDzxx75EM,633
|
|
132
|
-
fabricks/deploy/__init__.py,sha256=
|
|
133
|
-
fabricks/deploy/masks.py,sha256=
|
|
132
|
+
fabricks/deploy/__init__.py,sha256=G4U3gLVFBkedqH28dVsIee5D_hzhKZOP3FFJ9ygaNvU,2451
|
|
133
|
+
fabricks/deploy/masks.py,sha256=exf6UMutruHozw6oZY98DNAn464npbQlwN5-G22vDn8,236
|
|
134
134
|
fabricks/deploy/notebooks.py,sha256=pfmD1K-TCOuuxttEK45Ti1RDc-_nIOmWlb2EWr1Vp28,1545
|
|
135
135
|
fabricks/deploy/schedules.py,sha256=0a5dU1rW6fg8aAp7TTt-l0DgR-4kmzsX2xxV2C30yaw,347
|
|
136
|
-
fabricks/deploy/tables.py,sha256=
|
|
136
|
+
fabricks/deploy/tables.py,sha256=F_A3_BIf0x5GcWaBVMqrLG-GUOa7W3RSF2m-1ppxUgo,2636
|
|
137
137
|
fabricks/deploy/udfs.py,sha256=rBEzFKG_a9TKERceTLRC3b-2BjNe1YEIwU2r0I4EecE,637
|
|
138
138
|
fabricks/deploy/utils.py,sha256=V41r1zVT9KcsICqTLAzpb4ixRk2q2ybJMrGhkPOtG6k,5099
|
|
139
139
|
fabricks/deploy/views.py,sha256=8cSt6IzZy-JHHkyqd91NT2hi3LTNTOolimlfSBXMCvU,14434
|
|
@@ -171,6 +171,6 @@ fabricks/utils/schema/get_schema_for_type.py,sha256=5k-R6zCgUAtapQgxT4turcx1IQ-b
|
|
|
171
171
|
fabricks/utils/write/__init__.py,sha256=i0UnZenXj9Aq0b0_aU3s6882vg-Vu_AyKfQhl_dTp-g,200
|
|
172
172
|
fabricks/utils/write/delta.py,sha256=lTQ0CfUhcvn3xTCcT_Ns6PMDBsO5UEfa2S9XpJiLJ9c,1250
|
|
173
173
|
fabricks/utils/write/stream.py,sha256=wQBpAnQtYA6nl79sPKhVM6u5m-66suX7B6VQ6tW4TOs,622
|
|
174
|
-
fabricks-3.0.
|
|
175
|
-
fabricks-3.0.
|
|
176
|
-
fabricks-3.0.
|
|
174
|
+
fabricks-3.0.16.dist-info/METADATA,sha256=EUzxCf5zxbG8Dmst3_r4jyjK4Xb78n3pY0gajpZwqrg,798
|
|
175
|
+
fabricks-3.0.16.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
176
|
+
fabricks-3.0.16.dist-info/RECORD,,
|
|
File without changes
|