Skip to content

Restrict enumerated design space data value types.#958

Merged
anoto-moniz merged 1 commit into
mainfrom
bugfix/tighten-enumerated-ds-data-type
Jul 25, 2024
Merged

Restrict enumerated design space data value types.#958
anoto-moniz merged 1 commit into
mainfrom
bugfix/tighten-enumerated-ds-data-type

Conversation

@anoto-moniz

Copy link
Copy Markdown
Collaborator

The backend has always restricted them to strings, but the SDK never enforced it. And since the backend used a lax serde library, it would automatically coerce ints and floats to strings. To preserve backwards compatability while moving in the right direction, data is restricted to int, float, and str, and when assigning a data list, if any int or float values trigger a deprecation warning.

PR Type:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

The backend has always restricted them to strings, but the SDK never
enforced it. And since the backend used a lax serde library, it would
automatically coerce ints and floats to strings. To preserve backwards
compatability while moving in the right direction, `data` is restricted
to int, float, and str, and when assigning a data list, if any int or
float values trigger a deprecation warning.
@anoto-moniz anoto-moniz force-pushed the bugfix/tighten-enumerated-ds-data-type branch from e2f0c82 to 297d0e9 Compare July 25, 2024 18:48
@anoto-moniz anoto-moniz marked this pull request as ready for review July 25, 2024 18:51
@anoto-moniz anoto-moniz requested a review from kroenlein July 25, 2024 18:51

@kroenlein kroenlein left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@anoto-moniz anoto-moniz merged commit 015bcdc into main Jul 25, 2024
@anoto-moniz anoto-moniz deleted the bugfix/tighten-enumerated-ds-data-type branch July 25, 2024 19:04
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.

2 participants