Skip to content

Conversation

Pijukatel
Copy link
Contributor

@Pijukatel Pijukatel commented Sep 22, 2025

Description

  • Using unnamed Apify-based storage locally outside of the Apify platform will use the alias mechanism.

Issues

Closes: #599

Testing

Added unit tests

@github-actions github-actions bot added this to the 124th sprint - Tooling team milestone Sep 22, 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 22, 2025
@Pijukatel Pijukatel marked this pull request as ready for review September 22, 2025 13:21
@Pijukatel Pijukatel requested review from vdusek and janbuchar and removed request for vdusek September 22, 2025 13:23
Copy link
Contributor

@vdusek vdusek left a comment

Choose a reason for hiding this comment

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

One comment to the upgrading guide, I'll leave a proper review to @janbuchar.

Comment on lines 48 to 53
## Default storage ids in configuration changed to None
- `Configuration.default_key_value_store_id` changed from `'default'` to `None`.
- `Configuration.default_dataset_id` changed from `'default'` to `None`.
- `Configuration.default_request_queue_id` changed from `'default'` to `None`.

As a consequence of this change, using default storage without specifying its `id` in `Configuration` will use unnamed storage.
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH, this doesn't explain much - even I'm not sure what it would mean for me or what the consequences are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a more detailed explanation.

# If none are provided, try to get the default storage ID from environment variables.
elif id is None:
id = configuration.default_dataset_id
if not id:
Copy link
Contributor

Choose a reason for hiding this comment

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

But... this shouldn't happen thanks to the normalization step that you added, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will not happen, but mypy is not able to figure it out. Probably the code could be refactored to make it clearer to mypy, but I would leave it after the release, as it will be non-breaking pure refactoring, similar to #595 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we just use https://docs.python.org/3/library/typing.html#typing.assert_never? I don't believe that we'll ever come back to change this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is too much runtime checking. The mypy has no clue about max 1 kwargs of three runtime checks and so on. Let's not bend the code too much for the mypy's sake.

Anyway any such refactoring is non-breaking, so no need to rush it in before the release.

@Pijukatel Pijukatel force-pushed the default-storage-apify-local branch from bbf2069 to 6278302 Compare September 24, 2025 11:40
@Pijukatel Pijukatel requested a review from janbuchar September 24, 2025 11:41
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 you can fix that redundant ValueEror before merging this, I'd be much happier, but feel free to merge if that's too much trouble.

@Pijukatel Pijukatel merged commit dbea7d9 into master Sep 24, 2025
18 of 22 checks passed
@Pijukatel Pijukatel deleted the default-storage-apify-local branch September 24, 2025 12:47
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.

Convenient handling of default unnamed storages when running locally
3 participants