-
Notifications
You must be signed in to change notification settings - Fork 11
fix: Fir 35673 python sdk engine update fix renaming #399
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
fix: Fir 35673 python sdk engine update fix renaming #399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, otherwise looks good.
| param, value | ||
| parameters: List[Union[str, int]] = [] | ||
| if name is not None: | ||
| if not self._engine_name_re.match(name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking from a readability perspective, we can potentially do name.replace('_', '').isalnum() here and avoid regex altogether.
Don't feel too strongly about it, so up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather stick to the regexp as it fells more straightforward, while removing characters might be slightly confusing during reading
| ) | ||
| DROP_SQL: ClassVar[str] = 'DROP ENGINE "{}"' | ||
|
|
||
| _engine_name_re = re.compile(r"^[a-zA-Z0-9_]+$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep the regex approach let's pop a comment above it - "engine names can only be alphanumeric with underscores". Saves a second having to read the regex itself.
|


Fixed engine renaming for fb2.0