Skip to content

feat: Add support for passing URLs to the CLI - #65

Open
Adrian Freund (freundTech) wants to merge 2 commits into
Quantco:mainfrom
freundTech:add-uri-support
Open

Adrian Freund (freundTech) wants to merge 2 commits into
Quantco:mainfrom
freundTech:add-uri-support

Conversation

@freundTech

Copy link
Copy Markdown

Motivation

This allows enables passing URLs, such as S3 URLs to the diffly CLI, which enables comparing parquet files on network storage without manually downloading them first. The previously used pathlib.Path type converts double slashes in the protocol part of a URL, such as s3:// to a single slash, which breaks the URL.

Changes

Changed the type of the command line arguments left and right from pathlib.Path to str.

Additionally I added a test to test this behaviour. Sadly this requires adding a new test dependency: moto is used to mock an S3 server. Using the moto @mock_aws decorator is not enough, as Polars doesn't use boto3 to access S3. Instead we use ThreadedMotoServer and set the AWS environment variables to point to it. I also considered using a http:// URL with http.server, but that doesn't support range requests, which Polars depends on.

This is quite a lot of complexity for a single line change, so it might not be worth it, so I put it into a separate commit.

Copilot AI lite review requested due to automatic review settings September 19, 2026 15:49
@freundTech Adrian Freund (freundTech) changed the title Add support for passing URLs to the CLI feat:Add support for passing URLs to the CLI Sep 19, 2026
@freundTech Adrian Freund (freundTech) changed the title feat:Add support for passing URLs to the CLI feat: Add support for passing URLs to the CLI Sep 19, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Sep 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Declare boto3 explicitly as a test dependency; also update CLI help to mention URLs.

Review effort: Lite
Findings: None

What changed in this PR

Adds CLI support for comparing Parquet files from URLs, including S3 locations, while preserving URL schemes.

Changes:

  • Accepts CLI inputs as strings instead of Path objects.
  • Adds S3-backed integration test coverage.
  • Adds Moto and boto3-related test dependencies.
File Summary
tests/​cli/​test_cli.py Tests comparing Parquet files stored on S3.
pixi.toml Adds dependencies for S3 test infrastructure.
diffly/​cli.py Accepts local paths and URL strings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This enables passing URLs such as `s3://` to directly compare parquet
files stored on network storage. `pathlib.Path` collapses the
double slash into a single slash, which breaks the URL.
We add `moto` as a new test dependency to create a mock S3 server. This
allows us to test that passing `s3://` URLs to the cli works.
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.

2 participants