-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow removing filesystem info for local files #44
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks! Looks good to me. Some minor comments. I have tested this in production and it works for us.
@@ -4,6 +4,14 @@ | |||
|
|||
An example configuration file to retrieve data from a directory. | |||
|
|||
For backwards compatibility with pytroll collector’s trollstalker, the message config can have the `no_fs` set to | |||
`true` to sent messages without filesystem information and without `file://` prepended to the file uri. |
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.
`true` to sent messages without filesystem information and without `file://` prepended to the file uri. | |
`true` to send messages without filesystem information and without `file://` prepended to the file uri. |
with suppress(AttributeError): # fileitem is not a UPath if it cannot access .fs | ||
with dummy_connect(file_item): | ||
file_location["filesystem"] = json.loads(file_item.fs.to_json(include_password=False)) | ||
if no_fs: | ||
raise ValueError("Can’t have no_fs with remote files…") |
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.
raise ValueError("Can’t have no_fs with remote files…") | |
raise ValueError("Can't have no_fs with remote files…") |
I think we usually prefer ASCII source code (’ is RIGHT SINGLE QUOTATION MARK, 0x2019).
message_config=message_settings) | ||
assert len(published_messages) == 1 | ||
message = Message(rawstr=published_messages[0]) | ||
assert message.data["uri"].startswith("/") # or `os.sep` ? |
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.
Could this be different from "/"
?
This PR should fix #41