Skip to content

Commit 38e08f0

Browse files
Merge pull request #5 from databrickslabs/issue/apply_changes_infer_version_col_datatype
- Fixed infer datatypes from sequence_by to __START_AT, __END_AT for apply changes API - Changed setup.py for version - Removed Git release tag from github actions
2 parents 84945c1 + 4cbf6fb commit 38e08f0

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,4 @@ jobs:
3737
uses: pypa/gh-action-pypi-publish@release/v1
3838
with:
3939
user: __token__
40-
password: ${{ secrets.LABS_PYPI_TOKEN }}
41-
42-
- name: Create Release
43-
uses: actions/create-release@v1
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions
46-
with:
47-
tag_name: ${{ github.ref }}
48-
release_name: Release ${{ github.ref }}
49-
body: |
50-
Release for version ${{ github.ref }}. Please refer to CHANGELOG.md for detailed information.
51-
draft: false
52-
prerelease: false
40+
password: ${{ secrets.LABS_PYPI_TOKEN }}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
**NOTE:** For CLI interfaces, we support SemVer approach. However, for API components we don't use SemVer as of now. This may lead to instability when using dbx API methods directly.
99

1010
[Please read through the Keep a Changelog (~5min)](https://keepachangelog.com/en/1.0.0/).
11+
12+
## [v0.0.3] - 2023-06-07
13+
### Fixed
14+
- infer datatypes from sequence_by to __START_AT, __END_AT for apply changes API
15+
### Changed
16+
- setup.py for version
17+
### Removed
18+
- Git release tag from github actions
19+
1120
## [v0.0.2] - 2023-05-11
1221
### Added
1322
- Table properties support for bronze, quarantine and silver tables using create_streaming_live_table api call

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"""
2020
setup(
2121
name="dlt_meta",
22-
version="0.0.2",
22+
version="0.0.2.3",
2323
python_requires=">=3.8",
2424
setup_requires=["wheel>=0.37.1,<=0.40.0"],
2525
install_requires=INSTALL_REQUIRES,

src/dataflow_pipeline.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import dlt
55
from pyspark.sql import DataFrame
66
from pyspark.sql.functions import expr
7-
from pyspark.sql.types import IntegerType, StructType, StructField
7+
from pyspark.sql.types import StructType, StructField
88

99
from src.dataflow_spec import BronzeDataflowSpec, SilverDataflowSpec, DataflowSpecUtils
1010
from src.pipeline_readers import PipelineReaders
@@ -253,16 +253,20 @@ def cdc_apply_changes(self):
253253
else self.silver_schema
254254
)
255255

256+
sequenced_by_data_type = None
257+
256258
if cdc_apply_changes.except_column_list:
257259
modified_schema = StructType([])
258260
for field in struct_schema.fields:
259261
if field.name not in cdc_apply_changes.except_column_list:
260262
modified_schema.add(field)
263+
if field.name == cdc_apply_changes.sequence_by:
264+
sequenced_by_data_type = field.dataType
261265
struct_schema = modified_schema
262266

263267
if cdc_apply_changes.scd_type == "2":
264-
struct_schema.add(StructField("__START_AT", IntegerType()))
265-
struct_schema.add(StructField("__END_AT", IntegerType()))
268+
struct_schema.add(StructField("__START_AT", sequenced_by_data_type))
269+
struct_schema.add(StructField("__END_AT", sequenced_by_data_type))
266270

267271
dlt.create_streaming_live_table(
268272
name=f"{self.dataflowSpec.targetDetails['table']}",

0 commit comments

Comments
 (0)