Skip to content

TYP: Create DeepChainMap from ChainMap.new_child in scope.py #44769

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

Merged
merged 5 commits into from
Dec 14, 2021

Conversation

kashifkhan
Copy link
Contributor

xref #37715

scope is created as a DeepChainMap but on lines 139, 145, 262 call to new_child was returning ChainMap. Created a new DeepChainMap from the resulting ChainMap.

@pep8speaks
Copy link

pep8speaks commented Dec 5, 2021

Hello @kashifkhan! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-12-11 15:17:11 UTC

self.scope = self.scope.new_child( # type: ignore[assignment]
(global_dict or frame.f_globals).copy()
)
self.scope = DeepChainMap(self.scope.new_child( (global_dict or frame.f_globals).copy()))
Copy link
Member

Choose a reason for hiding this comment

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

can you do this on two lines, so

foo = self.scope.whatever
self.scope = DeepChainMap(foo)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, fixed in subsequent commits

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Dec 5, 2021
@jreback
Copy link
Contributor

jreback commented Dec 5, 2021

@kashifkhan seems to be failing precommit; you can run this locally (and fix up)

@jbrockmendel
Copy link
Member

CI should be fixed if you merge master

@kashifkhan
Copy link
Contributor Author

CI should be fixed if you merge master

Sure Ill take care of this tomorrow !!

@jreback jreback added this to the 1.4 milestone Dec 14, 2021
@jreback jreback merged commit d19b47f into pandas-dev:master Dec 14, 2021
@jreback
Copy link
Contributor

jreback commented Dec 14, 2021

thanks @kashifkhan

@kashifkhan kashifkhan deleted the fix_mypy_typ_err branch December 20, 2021 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants