Skip to content

Conversation

@yunzheng
Copy link
Member

@yunzheng yunzheng commented Dec 5, 2025

fixes #199

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.26%. Comparing base (f3a1c5f) to head (d907074).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
- Coverage   83.27%   83.26%   -0.02%     
==========================================
  Files          35       35              
  Lines        3696     3705       +9     
==========================================
+ Hits         3078     3085       +7     
- Misses        618      620       +2     
Flag Coverage Δ
unittests 83.26% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

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

This PR enhances path type detection in the fieldtypes module by adding string path support to the _is_posixlike_path() and _is_windowslike_path() helper functions. Previously, these functions only handled pathlib.PurePath objects; now they can also detect path types from raw string paths, enabling the path class to correctly determine whether a string argument represents a POSIX or Windows path.

  • Added string detection logic to _is_posixlike_path() (checks for "/" without "\")
  • Added string detection logic to _is_windowslike_path() (checks for Windows drive pattern or "\")
  • Updated tests to reflect new behavior where strings are now properly type-detected

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
flow/record/fieldtypes/init.py Added string path type detection to _is_posixlike_path() and _is_windowslike_path() helper functions
tests/fieldtypes/test_fieldtypes.py Updated test expectations to reflect that string "/foo/bar" is now correctly detected as POSIX-like, and adjusted test_path_multiple_parts to expect posix_path when the first argument is a POSIX-like string

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

yunzheng and others added 3 commits December 5, 2025 10:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
@yunzheng yunzheng requested a review from Schamper December 9, 2025 10:00
@yunzheng yunzheng merged commit cd69cf1 into main Dec 9, 2025
22 of 23 checks passed
@yunzheng yunzheng deleted the feature/fieldtypes-path-str branch December 9, 2025 10:31
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.

fieldtypes.path does not automatically detect posix or windows based on str

3 participants