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

RM-43-records_mover-db-mysql-load_options.py-113-1-C901-mysql_load_options-is-too-complex-18 #230

Conversation

ryantimjohn
Copy link
Contributor

No description provided.

RM-43 add helpful spacing

RM-43 refactor load options to use param object

RM-43 import Tuple

RM-43 use tuple class not object

RM-43 tuple type hinting

RM-43 update typing

RM-43 flake error

RM-43 fix type hints

RM-43 remove trailing whitespace

RM-43 start simplifying mysql load options
@ryantimjohn ryantimjohn force-pushed the RM-43-records_mover-db-mysql-load_options.py-113-1-C901-mysql_load_options-is-too-complex-18 branch from 371eb7c to 6788fcf Compare March 22, 2023 15:58
@ryantimjohn ryantimjohn requested a review from Brunope March 22, 2023 15:58
@ryantimjohn ryantimjohn marked this pull request as ready for review March 22, 2023 15:58
from the default, it is usually preferable to specify the
character set of the file by using the CHARACTER SET clause. A
character set of binary specifies “no conversion.”

Copy link
Collaborator

Choose a reason for hiding this comment

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

you should also mention that on success, this removes 'encoding' from the load parameters unhandled_hints. its a little weird to do modifications in a "getter" but eh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point; I'm open to another name. Additionally, PEP conventions suggest to skip get_ names entirely.

Any ideas for prepends? Maybe it'd just be better to skip them.

@ryantimjohn ryantimjohn marked this pull request as draft March 22, 2023 16:32
@ryantimjohn ryantimjohn marked this pull request as ready for review March 22, 2023 16:45
@Brunope
Copy link
Collaborator

Brunope commented Mar 22, 2023

I think the factoring of logic into process_ functions is fine, as is the load_params construct.

I don't love the fact that various get_ methods are also performing modifications on the hints via quiet_remove, maybe the removal can be lifted up a level to the caller after calling process_?

I'm also not a fan of moving these functions, especially the process_x ones, into a "utilities" file. They aren't shared functions to be used generically, they are very specific to mysql_load_options. I'd rather everything related live in one place, so I don't have to jump around to navigate, especially since it's a relatively simple sequence of process one thing, then process this next thing, then process the last thing, etc.

@ryantimjohn
Copy link
Contributor Author

I think the factoring of logic into process_ functions is fine, as is the load_params construct.

I don't love the fact that various get_ methods are also performing modifications on the hints via quiet_remove, maybe the removal can be lifted up a level to the caller after calling process_?

I'm also not a fan of moving these functions, especially the process_x ones, into a "utilities" file. They aren't shared functions to be used generically, they are very specific to mysql_load_options. I'd rather everything related live in one place, so I don't have to jump around to navigate, especially since it's a relatively simple sequence of process one thing, then process this next thing, then process the last thing, etc.

This all makes sense. If we want to do this, I do want to keep the docstrings so we're going to have to either (in order of preference) 1) make the bigfiles ignore comments or 2) get bigfiles to ignore this file entirely. I'm going to add a ticket to our board for that.

This reverts commit e6fa862.

RM-43 Bring comments into docstrings

RM-43 refactor to get around bigfiles

RM-43 move to relative import

Revert "RM-43 move to relative import"

This reverts commit 01e58e9.
@ryantimjohn ryantimjohn force-pushed the RM-43-records_mover-db-mysql-load_options.py-113-1-C901-mysql_load_options-is-too-complex-18 branch from 6e4a8f0 to 24f338f Compare March 23, 2023 19:39
@Brunope
Copy link
Collaborator

Brunope commented Mar 23, 2023

When I was looking for how to get bigfiles to ignore setup.py, I saw that there are some files excluded in Rakefile.quality. But I believe this excludes the files from ALL quality checks, not just bigfiles, which I don't know if we want.

Edit: I do think the docstrings are great and worth keeping as well.

@ryantimjohn
Copy link
Contributor Author

When I was looking for how to get bigfiles to ignore setup.py, I saw that there are some files excluded in Rakefile.quality. But I believe this excludes the files from ALL quality checks, not just bigfiles, which I don't know if we want.

Sounds like we might be coming around to the idea that it's just worth getting rid of the bigfiles check

@ryantimjohn
Copy link
Contributor Author

@Brunope seems like we might actually just be able to add a tag to the bigfiles invocation:
https://github.com/apiology/bigfiles

I'm going to try this out

@ryantimjohn
Copy link
Contributor Author

Oh I see, we just invoke quality without actually specifying bigfiles. Damn.

@ryantimjohn
Copy link
Contributor Author

Alright @Brunope this is now ready for review.

Copy link
Collaborator

@Brunope Brunope left a comment

Choose a reason for hiding this comment

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

looks great!

@ryantimjohn ryantimjohn added this pull request to the merge queue Mar 24, 2023
Merged via the queue into master with commit b7f2391 Mar 24, 2023
@ryantimjohn ryantimjohn deleted the RM-43-records_mover-db-mysql-load_options.py-113-1-C901-mysql_load_options-is-too-complex-18 branch March 27, 2023 14:58
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.

2 participants