fabrictools 0.7.2__tar.gz → 0.7.3__tar.gz
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.
- {fabrictools-0.7.2 → fabrictools-0.7.3}/PKG-INFO +1 -1
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/_version.py +1 -1
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/io/lakehouse.py +11 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/business.py +1 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools.egg-info/PKG-INFO +1 -1
- {fabrictools-0.7.2 → fabrictools-0.7.3}/README.md +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/core/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/core/logging.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/core/paths.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/core/spark.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/dimensions/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/dimensions/_targets.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/dimensions/date.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/dimensions/geo.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/dimensions/pipeline.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/io/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/io/discovery.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/io/warehouse.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/pipelines/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/pipelines/config.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/aggregations.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/pipeline.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/resolve.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/schema.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/semantic.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/prepare/transform.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/quality/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/quality/clean.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/quality/pipeline.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/quality/scan.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/__init__.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/columns.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/filter.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/merge.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/rows.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/text.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools/transform/wide_month_suffix.py +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools.egg-info/SOURCES.txt +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools.egg-info/dependency_links.txt +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools.egg-info/requires.txt +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/fabrictools.egg-info/top_level.txt +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/pyproject.toml +0 -0
- {fabrictools-0.7.2 → fabrictools-0.7.3}/setup.cfg +0 -0
|
@@ -281,6 +281,7 @@ def write_lakehouse(
|
|
|
281
281
|
spark: Optional[SparkSession] = None,
|
|
282
282
|
*,
|
|
283
283
|
normalize_column_names: bool = True,
|
|
284
|
+
enable_column_mapping: bool = False,
|
|
284
285
|
auto_partition: bool = True,
|
|
285
286
|
auto_partition_threshold_bytes: int = 1_073_741_824,
|
|
286
287
|
) -> None:
|
|
@@ -303,6 +304,9 @@ def write_lakehouse(
|
|
|
303
304
|
:py:func:`fabrictools.rename_columns_normalized` before
|
|
304
305
|
resolving ``partition_by`` and writing. If ``False``, keep physical column
|
|
305
306
|
names unchanged.
|
|
307
|
+
:param enable_column_mapping: If ``True`` and ``format="delta"``, writes table
|
|
308
|
+
properties required for Delta column mapping (mode ``name``), allowing
|
|
309
|
+
column names with spaces or special characters.
|
|
306
310
|
:param auto_partition: If ``True`` (default), automatically partition the data
|
|
307
311
|
by detected date columns if they exist.
|
|
308
312
|
:type df: ~pyspark.sql.DataFrame
|
|
@@ -313,6 +317,7 @@ def write_lakehouse(
|
|
|
313
317
|
:type format: str
|
|
314
318
|
:type spark: ~pyspark.sql.SparkSession | None
|
|
315
319
|
:type normalize_column_names: bool
|
|
320
|
+
:type enable_column_mapping: bool
|
|
316
321
|
|
|
317
322
|
.. rubric:: Example
|
|
318
323
|
|
|
@@ -367,6 +372,12 @@ def write_lakehouse(
|
|
|
367
372
|
writer = df.write.format(format).option("overwriteSchema", "true").mode(mode)
|
|
368
373
|
if format.lower() == "parquet":
|
|
369
374
|
writer = writer.option("datetimeRebaseMode", "CORRECTED")
|
|
375
|
+
elif format.lower() == "delta" and enable_column_mapping:
|
|
376
|
+
writer = (
|
|
377
|
+
writer.option("delta.columnMapping.mode", "name")
|
|
378
|
+
.option("delta.minReaderVersion", "2")
|
|
379
|
+
.option("delta.minWriterVersion", "5")
|
|
380
|
+
)
|
|
370
381
|
|
|
371
382
|
if effective_partition_by:
|
|
372
383
|
writer = writer.partitionBy(*effective_partition_by)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|