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

Allow removing filesystem info for local files #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mraspaud
Copy link
Member

This PR should fix #41

@mraspaud mraspaud added the enhancement New feature or request label Jan 10, 2025
@mraspaud mraspaud self-assigned this Jan 10, 2025
Copy link
Member

@gerritholl gerritholl left a 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`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…")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
raise ValueError("Cant 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` ?
Copy link
Member

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 "/"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URIs produced by pytroll-watches not understood by trollflow2/satpy
2 participants