fabricks 4.0.3__py3-none-any.whl → 4.0.5__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/models/config.py CHANGED
@@ -39,6 +39,7 @@ class HierarchicalFileSettingsSource(PydanticBaseSettingsSource):
39
39
 
40
40
  data = data.get("tool", {}).get("fabricks", {})
41
41
  data["base"] = str(base)
42
+ data["path_to_config"] = str(pyproject_path)
42
43
  return data
43
44
 
44
45
  return None
@@ -52,6 +53,7 @@ class HierarchicalFileSettingsSource(PydanticBaseSettingsSource):
52
53
  data = json.load(f)
53
54
 
54
55
  data["base"] = str(base)
56
+ data["path_to_config"] = str(json_path)
55
57
  return data
56
58
 
57
59
  return None
@@ -69,7 +71,7 @@ class HierarchicalFileSettingsSource(PydanticBaseSettingsSource):
69
71
  break
70
72
 
71
73
  if path == path.parent:
72
- break
74
+ raise FileNotFoundError("No configuration file found in hierarchy")
73
75
 
74
76
  path = path.parent
75
77
 
@@ -96,6 +98,10 @@ class ConfigOptions(BaseSettings):
96
98
  validation_alias=AliasChoices("FABRICKS_BASE", "base"),
97
99
  default="none",
98
100
  )
101
+ path_to_config: str = Field(
102
+ validation_alias=AliasChoices("FABRICKS_PATH_TO_CONFIG", "path_to_config"),
103
+ default="none",
104
+ )
99
105
  config: str = Field(
100
106
  validation_alias=AliasChoices("FABRICKS_CONFIG", "config"),
101
107
  default="none",
fabricks/utils/log.py CHANGED
@@ -7,8 +7,6 @@ from datetime import timezone as tz
7
7
  from typing import Optional, Tuple
8
8
  from zoneinfo import ZoneInfo
9
9
 
10
- from pyspark.sql import DataFrame
11
-
12
10
  from fabricks.utils.azure_table import AzureTable
13
11
 
14
12
 
@@ -62,23 +60,6 @@ class LogFormatter(logging.Formatter):
62
60
  exc_info = record.__dict__.get("exc_info", None)
63
61
  extra += f" [{self.COLORS[logging.ERROR]}{exc_info[0].__name__}{self.RESET}]" # type: ignore
64
62
 
65
- if hasattr(record, "df"):
66
- df = record.__dict__.get("df")
67
- if isinstance(df, DataFrame):
68
- try:
69
- pandas_df = df.toPandas()
70
- except Exception:
71
- # Handle timestamp precision/timezone issues by casting to string
72
- from pyspark.sql.functions import col
73
- from pyspark.sql.types import TimestampType
74
-
75
- for field in df.schema.fields:
76
- if isinstance(field.dataType, TimestampType):
77
- df = df.withColumn(field.name, col(field.name).cast("string"))
78
- pandas_df = df.toPandas()
79
-
80
- extra += f"\n---\n%df\n{pandas_df.to_string(index=True)}\n---"
81
-
82
63
  if hasattr(record, "json"):
83
64
  json_data = record.__dict__.get("json")
84
65
  extra += f"\n---\n{json.dumps(json_data, indent=2, default=str)}\n---"
@@ -173,7 +154,7 @@ class AzureTableLogHandler(logging.Handler):
173
154
  r["Exception"] = json.dumps(d)
174
155
 
175
156
  if hasattr(record, "json"):
176
- r["Data"] = json.dumps(record.__dict__.get("json", ""))
157
+ r["Json"] = json.dumps(record.__dict__.get("json", ""))
177
158
 
178
159
  if self.debugmode:
179
160
  if hasattr(record, "content"):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fabricks
3
- Version: 4.0.3
3
+ Version: 4.0.5
4
4
  Author-email: BMS DWH Team <bi_support@bmsuisse.ch>
5
5
  Requires-Python: <4,>=3.9
6
6
  Requires-Dist: azure-data-tables<13,>=12.5.0
@@ -145,7 +145,7 @@ fabricks/metastore/utils.py,sha256=8SxhjDkz_aSH4IGUusel7hqOQxP9U8PNBCY0M7GH00Y,1
145
145
  fabricks/metastore/view.py,sha256=f7hKJWtnH1KmZym8dkoucKOTndntzai_f2YqferxHLs,1431
146
146
  fabricks/models/__init__.py,sha256=XyW_vm5LyHOlAX_pD5LIi8V1G9u6KUUUKNYoTx4vh4I,3402
147
147
  fabricks/models/common.py,sha256=uSG1qpavz5l8EAVSDwPgiVxiGjOP3MWET87ppxlEtU4,2430
148
- fabricks/models/config.py,sha256=5ja4U_ap5pyOeApXEFU1GDCrd-7r8Le9CrUAGLYST4o,6759
148
+ fabricks/models/config.py,sha256=mwkxVTf7qFWXIMTZJxZP-Xgsm8VMlnBwsZGD0ocT6U8,7085
149
149
  fabricks/models/dependency.py,sha256=d811A_ug6i_3baAH1SfM45VGil7Yyx9iRjKhRRlswT4,1489
150
150
  fabricks/models/job.py,sha256=UdhVEXoBpdyZ9uLKN3j_wv9lbOPyp5uYWao7wOOxTlQ,4095
151
151
  fabricks/models/path.py,sha256=hJpOaiD6HSqsSKyF57j0ppyAXVYtAfWuHJXdT2rrj8I,384
@@ -160,7 +160,7 @@ fabricks/utils/azure_queue.py,sha256=wtKAq_MD5QLxelerDO475dzL-SySIrxt9d5KGi-8vvw
160
160
  fabricks/utils/azure_table.py,sha256=J_UAPiCN89rL5FNmwIGg43Z6FSH8evVIWijDEgYJxk4,5294
161
161
  fabricks/utils/console.py,sha256=X4lLgL_UxCjoFRx-ZRCwzdBveRGPKlFYZDi6vl7uevQ,1017
162
162
  fabricks/utils/helpers.py,sha256=2If-5cTO0ZCTgEVHS00Eh7Qv0YBdnZoSM7Rm1BdhhF8,7964
163
- fabricks/utils/log.py,sha256=KGljzsjLdu-HpAV1hsazSi78cnwyRaqnst54apH_foo,8835
163
+ fabricks/utils/log.py,sha256=uoNu4xyP-Jugv8A2dtjVfvUkl5CHhAGt8OloAXG4oIg,8032
164
164
  fabricks/utils/mermaid.py,sha256=XoiVxPaUJS4TC_ybA-e78qFzQkQ46uPf055JiiNDdSg,986
165
165
  fabricks/utils/path.py,sha256=_u_jFUWvlPj5KdT99tWffachVyokFUY8PCeVB1IzClY,11998
166
166
  fabricks/utils/pip.py,sha256=4rNmjy4h2352Lf6EX1qb7PB1qOP6Wm29P8Np6ISqt5w,1594
@@ -174,6 +174,6 @@ fabricks/utils/read/read_yaml.py,sha256=LlStrs1A1hCcgW5gHLEUx5ayC880JTO7EfhjxmtS
174
174
  fabricks/utils/write/__init__.py,sha256=i0UnZenXj9Aq0b0_aU3s6882vg-Vu_AyKfQhl_dTp-g,200
175
175
  fabricks/utils/write/delta.py,sha256=H0fXrrSCgHkZvq88gqtl4xy5Toy31p5fcXQP0VqqSWI,1286
176
176
  fabricks/utils/write/stream.py,sha256=HJxMpWf7Y2Q8dCS1LJzVOO_Tax_Q_YYsvDW69CSpMnw,640
177
- fabricks-4.0.3.dist-info/METADATA,sha256=Xima_GeKVvfKI4bx8ejsPpugzISA-RbyB85Fq4IpvWQ,954
178
- fabricks-4.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
179
- fabricks-4.0.3.dist-info/RECORD,,
177
+ fabricks-4.0.5.dist-info/METADATA,sha256=n10DNqDzp_GS-KbWWLrj2s4O6BKC9xG5pBJRTkBfbOU,954
178
+ fabricks-4.0.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
179
+ fabricks-4.0.5.dist-info/RECORD,,