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

Fix DoB and Age @ Player Profile #48

Merged
merged 1 commit into from
Dec 8, 2023
Merged

Conversation

felipeall
Copy link
Owner

@felipeall felipeall commented Dec 8, 2023

Summary by CodeRabbit

  • New Features

    • Implemented a new method for extracting players' date of birth and age using an updated regular expression pattern.
    • Enhanced player profile information retrieval with improved XPath expressions.
  • Refactor

    • Streamlined player profile data extraction by consolidating date of birth and age into a single attribute.
  • Bug Fixes

    • Fixed potential data extraction issues by utilizing a safer regex function for player profiles.

Copy link

vercel bot commented Dec 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
transfermarkt-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2023 1:48pm

Copy link

coderabbitai bot commented Dec 8, 2023

Warning

Rate Limit Exceeded

@felipeall has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 15 minutes and 9 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR.

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.

Commits Files that changed from the base of the PR and between df4f027 and 3619d34.

Walkthrough

The codebase has undergone a refactoring process to streamline the extraction of player profile data. A new regular expression (REGEX_DOB_AGE) has been introduced to match both date of birth and age, and the XPath queries have been adjusted to reflect changes in the data source structure. The get_player_profile method now utilizes the safe_regex function to parse this information, indicating a shift towards a more regex-centric approach for data extraction.

Changes

File Path Change Summary
app/services/players/profile.py Added imports for REGEX_DOB_AGE and safe_regex; updated get_player_profile to use safe_regex with REGEX_DOB_AGE.
app/utils/regex.py Introduced REGEX_DOB_AGE for matching date of birth and age.
app/utils/xpath.py Replaced DATE_OF_BIRTH with DATE_OF_BIRTH_AGE and removed AGE XPath, indicating a change in data extraction logic.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between df4f027 and bc22b28.
Files selected for processing (3)
  • app/services/players/profile.py (2 hunks)
  • app/utils/regex.py (1 hunks)
  • app/utils/xpath.py (1 hunks)
Additional comments: 3
app/services/players/profile.py (1)
  • 44-57: The changes to the get_player_profile method, including the use of safe_regex with REGEX_DOB_AGE for extracting dateOfBirth and age, align with the PR objectives to correctly represent a player's DoB and Age within their profile.
app/utils/regex.py (1)
  • 6-6: The addition of REGEX_DOB_AGE aligns with the PR objectives to accurately parse the date of birth and age from player profiles.
app/utils/xpath.py (1)
  • 17-25: The changes to the Profile class in app/utils/xpath.py correctly reflect the PR's objective to streamline the extraction of Date of Birth and Age information. The new DATE_OF_BIRTH_AGE attribute is consistent with the summary provided, indicating a shift to a single source for both pieces of data.

@felipeall felipeall force-pushed the fix/players/date-of-birth-age branch from f06d5a3 to 88eb97c Compare December 8, 2023 13:48
@felipeall felipeall merged commit abe603f into main Dec 8, 2023
3 checks passed
@felipeall felipeall deleted the fix/players/date-of-birth-age branch December 8, 2023 13:49
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between df4f027 and f06d5a3.
Files selected for processing (3)
  • app/services/players/profile.py (2 hunks)
  • app/utils/regex.py (1 hunks)
  • app/utils/xpath.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/utils/regex.py
Files skipped from review as they are similar to previous changes (1)
  • app/services/players/profile.py
Additional comments: 1
app/utils/xpath.py (1)
  • 17-25: The changes to the XPath expressions in the Profile class are consistent with the PR objectives to improve the handling of Date of Birth and Age data in player profiles. The consolidation of DATE_OF_BIRTH and AGE into a single DATE_OF_BIRTH_AGE attribute should simplify the data extraction process.

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.

1 participant