Skip to content
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

Fix attributes starting with numeric names raise ValueError #35

Merged
merged 5 commits into from
Nov 11, 2024

Conversation

JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Nov 11, 2024

Overview

This update addresses an issue reported by @kmika11 in the current version of EasyDataverse, where attribute names starting with a numerical character result in a ValueError raised by Pydantic, as attribute names cannot begin with a number.

This PR resolves the issue by converting the initial number into a human-readable string consisting solely of alphabetic characters. Additionally, if the attribute name begins with a non-alphanumeric character (other than a letter), that character will be removed. Serialization and deserialization remain unaffected, as the original name is retained as an alias.

TLDR

  • Fix handling of attributes that start with a numeric character
  • Add tests to validate the new functionality

@JR-1991 JR-1991 added bug Something isn't working enhancement New feature or request labels Nov 11, 2024
@JR-1991 JR-1991 added this to the 0.4.2 milestone Nov 11, 2024
@JR-1991 JR-1991 self-assigned this Nov 11, 2024
@JR-1991 JR-1991 merged commit c86eb82 into main Nov 11, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

1 participant