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

[MAINTENANCE] Typing Improvements - render/util #8279

Merged
merged 21 commits into from Jul 13, 2023

Conversation

Shinnnyshinshin
Copy link
Contributor

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses black + ruff)
  • Appropriate tests and docs have been updated

For more details, see our Contribution Checklist, Coding style guide, and Documentation style guide.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

Kilo59 and others added 4 commits July 11, 2023 14:36
Co-authored-by: Tyler Hoffman <tyler-hoffman@users.noreply.github.com>
Co-authored-by: Bill Dirks <bill.dirks@gmail.com>
Co-authored-by: William Shin <Shinnnyshinshin@users.noreply.github.com>
Co-authored-by: Chetan Kini <ckini123@gmail.com>
Co-authored-by: T Pham <TrangPham@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Jul 11, 2023

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 3fe0b55
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/64af375bf6673900080368d8

@ghost
Copy link

ghost commented Jul 11, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link
Member

Choose a reason for hiding this comment

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

great_expectations/render/util.py:399: error: Item "int" of
"Union[Dict[Any, Any], int]" has no attribute "keys"  [union-attr]
                set(unexpected_index_list[0].keys()).difference(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
great_expectations/render/util.py:411: error: Name "domain_column_name_list"
already defined on line 398  [no-redef]
            domain_column_name_list: list[str] = ["Value"]
            ^
great_expectations/render/util.py:412: error: Name
"unexpected_index_column_names" already defined on line 3[67](https://github.com/great-expectations/great_expectations/actions/runs/5523788553/jobs/10075189436?pr=8279#step:7:68)  [no-redef]
            unexpected_index_column_names: list[str] = ["Index"]
            ^
great_expectations/render/util.py:422: error: Value of type
"Optional[List[str]]" is not indexable  [index]
        col_to_count: str = unexpected_index_column_names[0]
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
great_expectations/render/util.py:431: error: Item "None" of
"Optional[List[str]]" has no attribute "__iter__" (not iterable)  [union-attr]
        for column in unexpected_index_column_names:
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 5 errors in 1 file (checked 515 source files)

@Shinnnyshinshin Shinnnyshinshin self-assigned this Jul 11, 2023
Copy link
Contributor

@billdirks billdirks left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! I wanted to highlight one issue inline.

set(unexpected_index_list[0].keys()).difference(
set(unexpected_index_column_names)
first_unexpected_index = unexpected_index_list[0]
if isinstance(first_unexpected_index, dict):
Copy link
Contributor

@billdirks billdirks Jul 11, 2023

Choose a reason for hiding this comment

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

This introduces a potential crasher. If first_unexpected_index is not a dict then we go into this branch but domain_column_name_list is never defined. We then crash when referring to it on line 419 below. You could instantiate it above or raise in an else to this if isinstance check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this @billdirks. updating now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated to include a TypeError.

@Shinnnyshinshin Shinnnyshinshin enabled auto-merge (squash) July 12, 2023 05:09
Copy link
Member

@Kilo59 Kilo59 left a comment

Choose a reason for hiding this comment

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

Thanks @Shinnnyshinshin !!

@Shinnnyshinshin Shinnnyshinshin merged commit 5d1fa0a into develop Jul 13, 2023
43 checks passed
@Shinnnyshinshin Shinnnyshinshin deleted the m/_/mob-coding-render-util branch July 13, 2023 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants