Skip to content

fix issue MapType as a type hint for schema 55900#55931

Open
deepanshu36 wants to merge 2 commits into
apache:masterfrom
deepanshu36:master
Open

fix issue MapType as a type hint for schema 55900#55931
deepanshu36 wants to merge 2 commits into
apache:masterfrom
deepanshu36:master

Conversation

@deepanshu36
Copy link
Copy Markdown

Why are the changes needed?

I have added a one line change to let spark know that u can have MapType also as a schema argument, earlier it did not consider schema argument in the file and niether imported it, i have added those change in the latest commit. please have a look

@deepanshu36
Copy link
Copy Markdown
Author

please have a look at the changes

Copy link
Copy Markdown
Author

@deepanshu36 deepanshu36 left a comment

Choose a reason for hiding this comment

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

Problem

from_json accepts MapType as a valid schema at runtime and
is even shown in the official documentation. However, the type
stub does not include MapType in the Union, causing type
checkers to raise an error.

Fixes #55900

Changes

  • Added MapType to the schema parameter type hint in from_json
  • Added MapType to the imports in the type stub

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