Skip to content

Handle valid_from=None in configuration version selection #946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ovv
Copy link
Contributor

@ovv ovv commented Jun 20, 2025

A configuration with valid_from=None is always valid

@ovv ovv marked this pull request as draft June 23, 2025 08:57
@ovv ovv force-pushed the ovv/lookup-quix-config-service-valid-from branch from 7179514 to 5cc2844 Compare June 26, 2025 12:52
@ovv ovv requested a review from Copilot June 26, 2025 15:16
Copilot

This comment was marked as outdated.

@ovv ovv force-pushed the ovv/lookup-quix-config-service-valid-from branch from c7129e5 to fff3b4f Compare July 1, 2025 09:54
@ovv ovv requested a review from Copilot July 1, 2025 09:54
Copy link
Contributor

@Copilot 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 configuration version handling to treat configurations with a None valid_from value as always valid. Key changes include updates to the event parsing in ConfigurationVersion.from_event, modifications in the version selection logic in find_valid_version and _find_versions to properly handle None values, and extensive tests to cover these scenarios.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/test_quixstreams/test_dataframe/test_joins/test_lookup_quix_config.py Added tests covering scenarios with valid_from set to None and various timestamp boundary cases
quixstreams/dataframe/joins/lookups/quix_configuration_service/models.py Updated type annotations and logic in from_event, find_valid_version, and _find_versions to handle valid_from=None
Comments suppressed due to low confidence (2)

quixstreams/dataframe/joins/lookups/quix_configuration_service/models.py:325

  • Consider adding a comment here to clarify that the early return is intentional when a version with no valid_from is encountered, meaning it is considered always valid and no further previous or next version is needed.
                    return previous_version, current_version, next_version

quixstreams/dataframe/joins/lookups/quix_configuration_service/models.py:150

  • Update the method-level docstring in from_event to explicitly state that when valid_from is None, the resulting configuration version is treated as always valid per the new selection logic.
        if raw_valid_from is None:

ovv added 2 commits July 1, 2025 12:50
…ive tests

- Refactor Configuration.find_valid_version and _find_versions to handle edge cases
- Add tests the quix configuration service lookup
@ovv ovv force-pushed the ovv/lookup-quix-config-service-valid-from branch from fff3b4f to 24bedb6 Compare July 1, 2025 10:50
@ovv ovv marked this pull request as ready for review July 1, 2025 11:09
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.

1 participant