Skip to content

Fix extension check for IncludedShotlistSetting#518

Merged
gtrevisan merged 2 commits intodevfrom
glt/str-endswith
Feb 12, 2026
Merged

Fix extension check for IncludedShotlistSetting#518
gtrevisan merged 2 commits intodevfrom
glt/str-endswith

Conversation

@gtrevisan
Copy link
Copy Markdown
Member

IncludedShotlistSetting might return a PosixPath, not a str.

$ uv run disruption-py cmod_ufo

[snip]
     if self.file_path.endswith(".parquet"):
       ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PosixPath' object has no attribute 'endswith'

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a crash in IncludedShotlistSetting/FileShotlistSetting when file_path is a pathlib.Path (e.g., from importlib.resources.as_file) by making the .parquet extension check work for non-str path types.

Changes:

  • Normalize self.file_path to a string for the .parquet extension check to avoid calling endswith on a Path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread disruption_py/settings/shotlist_setting.py Outdated
Comment thread disruption_py/settings/shotlist_setting.py Outdated
@gtrevisan gtrevisan merged commit ad711d9 into dev Feb 12, 2026
26 checks passed
@gtrevisan gtrevisan deleted the glt/str-endswith branch February 12, 2026 16:02
@gtrevisan gtrevisan mentioned this pull request Feb 12, 2026
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.

2 participants