Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "append" write mode. #154

Merged
merged 4 commits into from
Mar 31, 2022
Merged

Support "append" write mode. #154

merged 4 commits into from
Mar 31, 2022

Conversation

revit13
Copy link
Contributor

@revit13 revit13 commented Mar 31, 2022

Closes #153
Closes #152

This PR support append write mode. The default write mode is overwrite.
In addition, arrow flight version is upgraded to v7 to support writing csv files.

Signed-off-by: Revital Sur [email protected]
Co-authored-by: Mohammad Nassar [email protected]

@revit13 revit13 marked this pull request as draft March 31, 2022 05:05
afm/server.py Outdated Show resolved Hide resolved
Signed-off-by: Revital Sur <[email protected]>
Co-authored-by: Mohammad Nassar <[email protected]>
Signed-off-by: Revital Sur <[email protected]>
@revit13
Copy link
Contributor Author

revit13 commented Mar 31, 2022

@cdoron I addressed your comments. Thanks

afm/server.py Show resolved Hide resolved
afm/server.py Outdated
ds.write_dataset(transformed_batches, base_dir=asset.path, basename_template="part-{:%Y-%m-%d-%H-%M-%S-%f}-{{i}}.parquet".format(datetime.datetime.now()), format=asset.format, filesystem=asset.filesystem, existing_data_behavior='overwrite_or_ignore')
else:
logger.trace("write_mode: overwrite", extra={DataSetID: asset.name, ForUser: True})
ds.write_dataset(transformed_batches, base_dir=asset.path, basename_template="part-{:%Y-%m-%d-%H-%M-%S-%f}-{{i}}.parquet".format(datetime.datetime.now()), format=asset.format, filesystem=asset.filesystem, existing_data_behavior='delete_matching')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines 71-71 are almost identical to 73-74. Try to merge them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed thanks

@revit13 revit13 marked this pull request as ready for review March 31, 2022 09:33
Signed-off-by: Revital Sur <[email protected]>
Signed-off-by: Revital Sur <[email protected]>
@cdoron cdoron merged commit 3682a02 into fybrik:master Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support append when writing files Support writing csv files
3 participants