Skip to content

Fix search path None case.#706

Merged
JoeZiminski merged 8 commits into
mainfrom
fix_none_central_path_error
Mar 17, 2026
Merged

Fix search path None case.#706
JoeZiminski merged 8 commits into
mainfrom
fix_none_central_path_error

Conversation

@JoeZiminski
Copy link
Copy Markdown
Member

@JoeZiminski JoeZiminski commented Mar 17, 2026

central_path can be None if connection_method is gdrive. This case was not handled by validation when search_central is True, leading to an error. The None case is explicitly handled here.

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

Adjusts central (rclone-based) search to handle a None search path, intended to support Google Drive configurations where a central base path may be absent.

Changes:

  • Updates search_central_via_connection() to accept search_path: Path | None.
  • Builds an rclone lsjson target string from search_path, defaulting to an empty path when None.
  • Avoids joining search_path / name when search_path is None.

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

Comment thread datashuttle/utils/folders.py
Comment thread datashuttle/utils/folders.py
Comment thread datashuttle/utils/folders.py
Comment thread datashuttle/utils/folders.py
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

This PR updates the central-search helper to handle cases where the central search_path is None (notably for Google Drive configurations where central_path may be unset), preventing crashes when listing/searching the remote root.

Changes:

  • Allow search_central_via_connection() to accept search_path: Path | None.
  • Introduce final_search_path to safely build the rclone lsjson command when search_path is None.
  • Adjust returned “full path” construction to work when searching from the remote root.

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

Comment thread datashuttle/utils/folders.py
Comment thread datashuttle/utils/folders.py
Comment thread datashuttle/utils/folders.py
JoeZiminski and others added 2 commits March 17, 2026 18:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

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

@JoeZiminski
Copy link
Copy Markdown
Member Author

@copilot can't you make those changes on this PR? it makes no sense for them to be applied on another PR

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

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

Copilot AI and others added 2 commits March 17, 2026 18:33
…earch_path` is `None` (#708)

* Initial plan

* Move display_search_path into if block with rclone remote name for None case

Co-authored-by: JoeZiminski <55797454+JoeZiminski@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoeZiminski <55797454+JoeZiminski@users.noreply.github.com>
…#707)

* Initial plan

* Add test for search_central_via_connection with search_path=None

Co-authored-by: JoeZiminski <55797454+JoeZiminski@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoeZiminski <55797454+JoeZiminski@users.noreply.github.com>
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

This PR fixes the search_path=None edge case when searching central storage via rclone (notably needed for Google Drive configurations where cfg["central_path"] can be None), and adds an integration test to prevent regressions.

Changes:

  • Update search_central_via_connection() to accept search_path: Path | None, treat None as a remote-root search, and improve error-message context for the root case.
  • Add an explicit None guard in search_local_filesystem() to fail fast with a clear error.
  • Add an integration test covering search_central_via_connection(..., search_path=None, ...) for both return_full_path=True/False.

Reviewed changes

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

File Description
tests/tests_integration/test_search_methods.py Adds integration coverage for search_path=None behavior in central search.
datashuttle/utils/folders.py Implements None handling for central search paths and improves diagnostics; adds a guard for local search.

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

Comment thread tests/tests_integration/test_search_methods.py
@JoeZiminski JoeZiminski merged commit 05924af into main Mar 17, 2026
15 checks passed
@JoeZiminski JoeZiminski deleted the fix_none_central_path_error branch March 17, 2026 20:08
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.

3 participants