Skip to content

Conversation

Pijukatel
Copy link
Contributor

Description

Issues

Testing

  • Added new tests for relevant kvs and datasets clients' methods.

@github-actions github-actions bot added this to the 123rd sprint - Tooling team milestone Sep 10, 2025
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Sep 10, 2025
@Pijukatel Pijukatel marked this pull request as ready for review September 10, 2025 10:57
Copy link
Contributor

@barjin barjin left a comment

Choose a reason for hiding this comment

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

Thank you!

Looks mostly good to me, although I'd prefer to leave the approval to an actual Python dev :) Some Grammarly nits about the comments and one question:

@Pijukatel Pijukatel requested a review from barjin September 10, 2025 16:08
Copy link
Contributor

@barjin barjin left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you for the fixes!

Comment on lines 68 to 69
assert kvs_client._url() == f'{non_existent_url}/v2/key-value-stores/{kvs_name}'
assert kvs_client._url(public=True) == f'{DEFAULT_API_URL}/v2/key-value-stores/{kvs_name}'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we test _-prefixed methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, I wanted to avoid mocking the API calls, but that was actually the correct approach. I reworked the tests.

('https://api.apify.com', 'https://custom-public-url.com'),
('https://api.apify.com', 'https://custom-public-url.com/with/custom/path'),
('https://api.apify.com', 'https://custom-public-url.com/with/custom/path/'),
('http://10.0.88.214:8010', 'https://api.apify.com'),
Copy link
Contributor

Choose a reason for hiding this comment

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

I hate to be a stickler for detail, but now we're testing this:

client = ApifyClient(base_url="10.0.0...", public_base_url="https://api.apify.com")
assert "api.apify.com" in client.kvs.public_url() 

While the failing case from the original issue would be something like

client = ApifyClient(base_url="10.0.0...") # no public url passed, only base
assert "api.apify.com" in client.kvs.public_url()  # yet, this assert still passes

Not that it really matters, but I wanted to propose this with the previous commit and ultimately revoked my comment, because I noticed this difference :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

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

If I'm not mistaken, there will need to be a change in the SDK as well so that it passes the correct public api url on the platform?

@Pijukatel Pijukatel requested a review from janbuchar September 12, 2025 07:40
@Pijukatel Pijukatel requested a review from janbuchar September 12, 2025 11:12
@Pijukatel Pijukatel merged commit b224218 into master Sep 12, 2025
26 checks passed
@Pijukatel Pijukatel deleted the custom-public-url branch September 12, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public resource URLs shouldn't refer to base API URL
3 participants