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

feat: added gamemode and platform filtering on all player data endpoint #209

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

TeKrop
Copy link
Owner

@TeKrop TeKrop commented Nov 3, 2024

Summary by Sourcery

Implement gamemode and platform filtering for player career data endpoint and enhance the player career parser to support these filters. Update tests to cover new filtering functionality and error handling scenarios.

New Features:

  • Add gamemode and platform filtering to the player career data endpoint, allowing users to filter player data based on specific gamemodes and platforms.

Enhancements:

  • Refactor player career parser to support new filtering capabilities for gamemode and platform.

Tests:

  • Introduce new tests for player career parser to validate gamemode and platform filtering functionality.
  • Add tests to handle parsing errors such as AttributeError, KeyError, and TypeError in player career parser.

@TeKrop TeKrop added the enhancement New feature or request label Nov 3, 2024
@TeKrop TeKrop self-assigned this Nov 3, 2024
Copy link
Contributor

sourcery-ai bot commented Nov 3, 2024

Reviewer's Guide by Sourcery

This PR adds gamemode and platform filtering capabilities to the player career endpoint. The implementation includes refactoring the player career parser to handle filtered data requests, adding new query parameters to the API endpoint, and improving error handling. The changes also include splitting test files and updating the search functionality to handle player names more effectively.

Class diagram for PlayerCareerParser changes

classDiagram
    class PlayerCareerParser {
        +filter_request_using_query(kwargs)
        +_filter_stats(kwargs)
        +_filter_all_stats_data(kwargs)
        +parse_data()
    }
    note for PlayerCareerParser "Added _filter_all_stats_data method and updated filter_request_using_query method to handle gamemode and platform filtering."
Loading

File-Level Changes

Change Details Files
Added filtering functionality for gamemode and platform in player career data
  • Implemented new _filter_all_stats_data method to handle platform and gamemode filtering
  • Updated filter_request_using_query to support new filtering options
  • Added platform and gamemode query parameters to the player career endpoint
app/players/parsers/player_career_parser.py
app/players/router.py
Improved player search functionality
  • Modified URL generation to use player name without battle tag
  • Updated search data parser to handle player names consistently
app/players/parsers/search_data_parser.py
app/players/parsers/player_search_parser.py
Enhanced test coverage and organization
  • Split player career parser tests into separate files
  • Added comprehensive tests for new filtering functionality
  • Added error handling test cases for various parsing scenarios
tests/players/parsers/test_player_career_parser.py
tests/players/parsers/test_player_career_stats_parser.py
Version bump and cleanup
  • Incremented version from 3.0.0 to 3.1.0
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @TeKrop - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

sonarqubecloud bot commented Nov 4, 2024

@TeKrop TeKrop merged commit 6620eaa into main Nov 4, 2024
3 checks passed
@TeKrop TeKrop deleted the feature/all-player-data-filtering branch November 4, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant