-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: Add store_full_path to converters (2/3) #8573
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 11974098350Details
💛 - Coveralls |
for text, extra_meta in data: | ||
merged_metadata = {**bytestream.meta, **metadata, **extra_meta} | ||
|
||
if not self._store_full_path and "file_path" in bytestream.meta: | ||
file_path = bytestream.meta.get("file_path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do this with the walrus operator, merging if the assignment in one go
if file_path := bytestream.meta.get("file_path"):
merged_metadata["file_path"] = os.path.basename(file_path)
|
||
if not self.store_full_path and "file_path" in bytestream.meta: | ||
file_path = bytestream.meta.get("file_path") | ||
if file_path: # Ensure the value is not None for pylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something as above
|
||
if not self.store_full_path and "file_path" in bytestream.meta: | ||
file_path = bytestream.meta.get("file_path") | ||
if file_path: # Ensure the value is not None for pylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something here
|
||
if not self.store_full_path and "file_path" in bytestream.meta: | ||
file_path = bytestream.meta.get("file_path") | ||
if file_path: # Ensure the value is not None for pylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something here
|
||
if not self.store_full_path and "file_path" in bytestream.meta: | ||
file_path = bytestream.meta.get("file_path") | ||
if file_path: # Ensure the value is not None for pylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something here
|
||
if not self.store_full_path and "file_path" in bytestream.meta: | ||
file_path = bytestream.meta.get("file_path") | ||
if file_path: # Ensure the value is not None for pylint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
|
||
deprecations: | ||
- | | ||
The default value of the `store_full_path` parameter will be changed to `False` in Haysatck 2.9.0 to enhance privacy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value of the `store_full_path` parameter will be changed to `False` in Haysatck 2.9.0 to enhance privacy. | |
The default value of the `store_full_path` parameter will change to `False` in Haysatck 2.9.0 to enhance privacy. |
@Amnah199 looks good, left a comment regarding small improvement |
Related Issues
Proposed Changes:
This PR is similar to #8566
Add a new parameter to the
__init__
method to allow users to toggle whether thefile_path
in metadata stores the complete file path or only the base file name. ADeprecationWarning
is generated about the upcoming change infile_path
storage behavior in the next release.How did you test it?
Added new test for checking the parameter function
CI
Notes for the reviewer
This is 2/3 PRs that will add the same change to other converters. PR has many files but they all include the same change.
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.