fabricks 3.0.13__py3-none-any.whl → 3.0.15__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/context/helpers.py +6 -1
- fabricks/core/udfs.py +13 -5
- fabricks/deploy/udfs.py +2 -2
- {fabricks-3.0.13.dist-info → fabricks-3.0.15.dist-info}/METADATA +1 -1
- {fabricks-3.0.13.dist-info → fabricks-3.0.15.dist-info}/RECORD +6 -6
- {fabricks-3.0.13.dist-info → fabricks-3.0.15.dist-info}/WHEEL +0 -0
fabricks/context/helpers.py
CHANGED
|
@@ -8,9 +8,14 @@ from fabricks.utils.path import Path
|
|
|
8
8
|
def get_config_from_file():
|
|
9
9
|
path = pathlib.Path(os.getcwd())
|
|
10
10
|
|
|
11
|
-
while path is not None
|
|
11
|
+
while path is not None:
|
|
12
|
+
if (path / "fabricksconfig.json").exists():
|
|
13
|
+
break
|
|
14
|
+
if (path / "pyproject.toml").exists():
|
|
15
|
+
break
|
|
12
16
|
if path == path.parent:
|
|
13
17
|
break
|
|
18
|
+
|
|
14
19
|
path = path.parent
|
|
15
20
|
|
|
16
21
|
if (path / "fabricksconfig.json").exists():
|
fabricks/core/udfs.py
CHANGED
|
@@ -11,7 +11,7 @@ from fabricks.context.log import DEFAULT_LOGGER
|
|
|
11
11
|
UDFS: dict[str, Callable] = {}
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def register_all_udfs(extension: Optional[str] = None):
|
|
14
|
+
def register_all_udfs(extension: Optional[str] = None, override: bool = False):
|
|
15
15
|
"""
|
|
16
16
|
Register all user-defined functions (UDFs).
|
|
17
17
|
"""
|
|
@@ -20,7 +20,7 @@ def register_all_udfs(extension: Optional[str] = None):
|
|
|
20
20
|
for udf in get_udfs(extension=extension):
|
|
21
21
|
split = udf.split(".")
|
|
22
22
|
try:
|
|
23
|
-
register_udf(udf=split[0], extension=split[1])
|
|
23
|
+
register_udf(udf=split[0], extension=split[1], override=override)
|
|
24
24
|
except Exception as e:
|
|
25
25
|
DEFAULT_LOGGER.exception(f"could not register udf {udf}", exc_info=e)
|
|
26
26
|
|
|
@@ -57,7 +57,12 @@ def is_registered(udf: str, spark: Optional[SparkSession] = None) -> bool:
|
|
|
57
57
|
return not df.isEmpty()
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
def register_udf(
|
|
60
|
+
def register_udf(
|
|
61
|
+
udf: str,
|
|
62
|
+
extension: Optional[str] = None,
|
|
63
|
+
spark: Optional[SparkSession] = None,
|
|
64
|
+
override: bool = False,
|
|
65
|
+
):
|
|
61
66
|
"""
|
|
62
67
|
Register a user-defined function (UDF).
|
|
63
68
|
"""
|
|
@@ -65,8 +70,11 @@ def register_udf(udf: str, extension: Optional[str] = None, spark: Optional[Spar
|
|
|
65
70
|
spark = SPARK
|
|
66
71
|
assert spark is not None
|
|
67
72
|
|
|
68
|
-
if not is_registered(udf, spark):
|
|
69
|
-
|
|
73
|
+
if not is_registered(udf, spark) or override:
|
|
74
|
+
if override:
|
|
75
|
+
DEFAULT_LOGGER.debug(f"override udf {udf}")
|
|
76
|
+
else:
|
|
77
|
+
DEFAULT_LOGGER.debug(f"register udf {udf}")
|
|
70
78
|
|
|
71
79
|
if extension is None:
|
|
72
80
|
extension = get_extension(udf)
|
fabricks/deploy/udfs.py
CHANGED
|
@@ -4,10 +4,10 @@ from fabricks.core.udfs import register_all_udfs
|
|
|
4
4
|
from fabricks.utils.sqlglot import fix as fix_sql
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def deploy_udfs():
|
|
7
|
+
def deploy_udfs(override: bool = True):
|
|
8
8
|
DEFAULT_LOGGER.info("create or replace udfs")
|
|
9
9
|
|
|
10
|
-
register_all_udfs(extension="sql")
|
|
10
|
+
register_all_udfs(extension="sql", override=override)
|
|
11
11
|
create_or_replace_udf_job_id()
|
|
12
12
|
|
|
13
13
|
|
|
@@ -70,7 +70,7 @@ fabricks/cdc/templates/queries/nocdc/update.sql.jinja,sha256=mjNUwGVhZ08yUkdv9sC
|
|
|
70
70
|
fabricks/context/__init__.py,sha256=qfntJ9O6omzY_t6AhDP6Ndu9C5LMiVdWbo6ikhtoe7o,1446
|
|
71
71
|
fabricks/context/_types.py,sha256=FzQJ35vp0uc6pAq18bc-VHwMVEWtd0VDdm8xQmNr2Sg,2681
|
|
72
72
|
fabricks/context/config.py,sha256=EmLUnswuWfrncaNJMDjvdMg-1lD8aneKAY8IDna7VPE,4814
|
|
73
|
-
fabricks/context/helpers.py,sha256=
|
|
73
|
+
fabricks/context/helpers.py,sha256=igY8LwLIxzfOWKCg23XMsJoY7Bw0welpdNry2mKHjF0,1600
|
|
74
74
|
fabricks/context/log.py,sha256=CadrRf8iL6iXlGIGIhEIswa7wGqC-E-oLwWcGTyJ10s,2074
|
|
75
75
|
fabricks/context/runtime.py,sha256=87PtX6SqLoFd0PGxgisF6dLlxtCHaHxkMMIt34UyB2w,3479
|
|
76
76
|
fabricks/context/secret.py,sha256=iRM-KU-JcJAEOLoGJ8S4Oh65-yt674W6CDTSkOE7SXw,3192
|
|
@@ -80,7 +80,7 @@ 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
82
|
fabricks/core/masks.py,sha256=3UCxcCi-TgFHB7xT5ZvmEa8RMKev23X_JLE70Pr3rpY,1347
|
|
83
|
-
fabricks/core/udfs.py,sha256=
|
|
83
|
+
fabricks/core/udfs.py,sha256=1HoalZcfdGsF2DeJvdOWkw_7v6YavL-7wJcYR9jI9HY,3153
|
|
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
|
|
@@ -134,7 +134,7 @@ fabricks/deploy/masks.py,sha256=umDRGoeyGnJ6_-Ug7926oDEtkdp9Ja5TtgznpQBUzBY,198
|
|
|
134
134
|
fabricks/deploy/notebooks.py,sha256=pfmD1K-TCOuuxttEK45Ti1RDc-_nIOmWlb2EWr1Vp28,1545
|
|
135
135
|
fabricks/deploy/schedules.py,sha256=0a5dU1rW6fg8aAp7TTt-l0DgR-4kmzsX2xxV2C30yaw,347
|
|
136
136
|
fabricks/deploy/tables.py,sha256=IF822oxOCy12r08Dz54YUK5luud6dtTPxJ4TUIHE-No,2621
|
|
137
|
-
fabricks/deploy/udfs.py,sha256=
|
|
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
|
|
140
140
|
fabricks/metastore/README.md,sha256=utPUGAxmjyNMGe43GfL0Gup4MjeTKKwyiUoNVSfMquI,51
|
|
@@ -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.15.dist-info/METADATA,sha256=qmUoNHO1DjqiqLdtbndeKG7Z-JXIr9MuRGnV6Kpb2rE,798
|
|
175
|
+
fabricks-3.0.15.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
176
|
+
fabricks-3.0.15.dist-info/RECORD,,
|
|
File without changes
|