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

Pass in the type as a string #1851

Closed
Fokko opened this issue Mar 26, 2025 · 2 comments · Fixed by #1860
Closed

Pass in the type as a string #1851

Fokko opened this issue Mar 26, 2025 · 2 comments · Fixed by #1860
Labels
good first issue Good for newcomers

Comments

@Fokko
Copy link
Contributor

Fokko commented Mar 26, 2025

Feature Request / Improvement

Right now we expect to pass in the actual string:

schema = Schema(
    NestedField(1, 'foo', StringType())
)

I think it would be nice to also allow strings:

schema = Schema(
    NestedField(1, 'foo', 'string')
)

At the same time, we should reject complex types (list/map/struct).

@Fokko Fokko added the good first issue Good for newcomers label Mar 26, 2025
@kevinjqliu
Copy link
Contributor

'string' here should match the literal in the PrimitiveType

root: Literal["string"] = Field(default="string")

@sunxiaojian
Copy link
Contributor

sunxiaojian commented Mar 28, 2025

@Fokko I made an attempt to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants