Fix: Resolve issues in Postgres name normalization when names are >63 characters#359
Conversation
|
Warning Rate limit exceededAaron ("AJ") Steers (@aaronsteers) has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 7 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughWalkthroughThis pull request introduces modifications to the Changes
Possibly related PRs
Suggested labels
Do you think we should include a brief description of the purpose of the new parameters in the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
airbyte/shared/sql_processor.py (1)
500-512: The modified logic in the_get_temp_table_namemethod looks good! 👍
- Checking the length of
batch_idand constructing the suffix differently based on the length is a good way to ensure that the resulting table name is unique and adheres to potential database constraints on name lengths.- Using the first 6 and last 3 characters of
batch_idwhen the length exceeds 9 characters is a nice approach to maintain uniqueness while limiting the suffix length.- The comments provide a clear explanation of the reasoning behind the changes and the potential database constraints that are being addressed.
Just a minor suggestion: What do you think about using a ternary operator instead of the
if-elseblock? Something like this:suffix = f"{batch_id[:6]}{batch_id[-3:]}" if len(batch_id) > 9 else batch_idThis could make the code a bit more concise. But it's totally up to you! The current implementation is perfectly fine as well.
Tools
Ruff
503-508: Use ternary operator
suffix = f"{batch_id[:6]}{batch_id[-3:]}" if len(batch_id) > 9 else batch_idinstead ofif-else-block(SIM108)
503-503: Magic value used in comparison, consider replacing
9with a constant variable(PLR2004)
|
/fix-pr
|
|
/fix-pr
|
|
/fix-pr
|
There was a problem hiding this comment.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
tests/unit_tests/test_text_normalization.py (1)
190-231: Great addition of test cases for the PostgresNormalizer!The changes to the
test_lower_case_normalizerfunction look good:
- The addition of the
normalizer_classparameter allows the function to test different normalizer classes, which is a nice improvement.- The additional test cases for the
PostgresNormalizerclass ensure that it behaves as expected, especially regarding the truncation behavior for long strings.Just one small suggestion: What do you think about renaming the function to
test_normalizersince it now tests multiple normalizer classes?
abf16e9 to
9ef9139
Compare
Summary by CodeRabbit