Skip to content

Conversation

@jacobdadams
Copy link
Member

@jacobdadams jacobdadams commented Dec 30, 2025

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 96.82540% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.69%. Comparing base (f87f4c5) to head (44fbada).
⚠️ Report is 122 commits behind head on main.

Files with missing lines Patch % Lines
src/palletjack/extract.py 95.91% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #175      +/-   ##
==========================================
+ Coverage   94.52%   95.69%   +1.16%     
==========================================
  Files           7        7              
  Lines        1133     1254     +121     
  Branches      148      147       -1     
==========================================
+ Hits         1071     1200     +129     
+ Misses         52       44       -8     
  Partials       10       10              

☔ 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.

@jacobdadams jacobdadams marked this pull request as ready for review December 30, 2025 17:08
steveoh
steveoh previously approved these changes Dec 30, 2025
Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

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

This all looks sound to me. :shipit:

For fun and my own curiosity, gemini replaced the fabric bits with paramiko directly and it's straight forward for the SFTP transfers.

I accept that fabric has a more friendly api and is the paramiko recommendation. For this usage, paramiko doesn't seem to be too low level or advanced.

If there is a desire for faster build times and a leaner container memory wise, I think it's worth considering paramiko.

@jacobdadams
Copy link
Member Author

You're welcome to spend the time to submit a commit that uses paramiko and updates/replaces all the tests. Otherwise, I'm sticking with fabric.

@jacobdadams jacobdadams changed the title wip: sprint 6 work Sprint 6 work Dec 30, 2025
@steveoh
Copy link
Member

steveoh commented Dec 30, 2025

You're welcome to spend the time to submit a commit that uses paramiko and updates/replaces all the tests. Otherwise, I'm sticking with fabric.

Thanks for the offer, but that isn't a priority for me right now. I approved this so unless you are going to wait for Scott, 🚢

@jacobdadams
Copy link
Member Author

@stdavis, when you're back and dug out, I would appreciate your review of the folder.add changes; I cribbed them from dolly-carton and I think it was straight forward but just want to check. This is also evidence that you were right to want to move some of that into its own library.

@steveoh
Copy link
Member

steveoh commented Dec 31, 2025

@copilot create a child pull request replacing the fabric dependency with paramiko.

Scope:

  1. Fabric is currently only used for SFTP operations. Do not implement any general SSH command execution.
  2. The current authentication does not use SSH keys (password/plain auth).

Implementation Details:

  1. Follow all coding standards, formatting styles, and naming conventions found in the project.
  2. Replace fabric in install_requires (or requirements files) with paramiko.
  3. Important: Implement a context manager (using with or try/finally) to ensure the SFTP session and the underlying Transport are always closed, even if errors occur.
  4. Map fabric exceptions to standard Python exceptions or paramiko specific ones where appropriate.
  5. Refactor tests to use paramiko. Ensure you mock both paramiko.Transport and paramiko.SFTPClient correctly to avoid actual network calls.
  6. Verify that no fabric imports remain.
  7. Ensure all refactored tests pass.

Copy link
Contributor

Copilot AI commented Dec 31, 2025

@steveoh I've opened a new pull request, #176, to work on those changes. Once the pull request is ready, I'll request review from you.

stdavis
stdavis previously approved these changes Jan 1, 2026
Copy link
Member

@stdavis stdavis left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copilot AI and others added 8 commits January 5, 2026 10:35
Co-authored-by: steveoh <325813+steveoh@users.noreply.github.com>
Co-authored-by: steveoh <325813+steveoh@users.noreply.github.com>
Added 7 new test cases to improve coverage:
- Success path with proper cleanup
- Connection failure handling
- Authentication failure handling
- SFTP client creation failure
- Exception during operations
- Integration tests with real context manager

Coverage increased from 94% to 96%

Co-authored-by: steveoh <325813+steveoh@users.noreply.github.com>
Co-authored-by: steveoh <325813+steveoh@users.noreply.github.com>
- Fixed invalid escape sequences in regex patterns (extract.py lines 137, 195)
  Changed to raw strings (r"...") for proper regex syntax
- Fixed FutureWarning for incompatible dtype assignment (load.py line 577)
  Changed from np.nan to pd.Series(dtype="object") for proper string/NaN handling

All tests pass (369/370), coverage maintained at 96%

Co-authored-by: steveoh <325813+steveoh@users.noreply.github.com>
Changed from pd.Series(dtype="object") to pd.Series([np.nan] * len(df), dtype="object", index=df.index)
to properly handle index alignment and maintain np.nan for compatibility with tests

All tests pass (369/370), coverage maintained at 96%

Co-authored-by: steveoh <325813+steveoh@users.noreply.github.com>
- Added overwrite_existing_files boolean parameter to download_sftp_folder_contents (default=True)
- Raises FileExistsError when overwrite_existing_files=False and file exists
- Changed file counting to track downloaded files instead of directory count
- Fixed path separator issues by using Path.as_posix() for cross-platform compatibility
- Added 2 new tests for overwrite behavior
- Updated all affected tests to handle new behavior

All 371 tests pass, coverage maintained at 95%

Co-authored-by: jacobdadams <38168030+jacobdadams@users.noreply.github.com>
Moved empty file list check inside first SFTP connection context
to avoid opening second connection when no files to download

All 371 tests pass, coverage maintained at 95%

Co-authored-by: jacobdadams <38168030+jacobdadams@users.noreply.github.com>
@jacobdadams jacobdadams dismissed stale reviews from stdavis and steveoh via 44fbada January 5, 2026 17:35
@jacobdadams
Copy link
Member Author

Ok, I've pulled in the paramiko branch, so if it still looks good to you guys we'll merge this into main (and hopefully kick off a new 6.0 release)

@jacobdadams jacobdadams requested review from stdavis and steveoh January 5, 2026 17:43
@jacobdadams jacobdadams merged commit eeea8f8 into main Jan 5, 2026
8 checks passed
@jacobdadams jacobdadams deleted the dev branch January 5, 2026 18:43
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.

Replace pysftp with paramiko Check for np.inf in dataframes

4 participants