Add include_career_stats flag to scrape_player_details - #92
Open
YonatanHen wants to merge 5 commits into
Open
Conversation
Adds an optional include_career_stats parameter (default True) so callers can skip the per-player career stats API call when that data isn't needed, reducing scrape time. Updates SofascorePlayer.career_stats type annotation to pd.DataFrame | None accordingly.
Renamed team_row to team_row_df after .to_frame().T to avoid reassigning a Series variable with a DataFrame value.
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 3 high |
🟢 Metrics 0 complexity · 0 duplication
Metric Results Complexity 0 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Python | Jun 3, 2026 12:50p.m. | Review ↗ | |
| Code coverage | Jun 3, 2026 12:50p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include_career_stats: bool = Trueparameter toscrape_player_detailsinsofascore.py. When set toFalse, the per-player career stats API call is skipped, reducing scrape time when that data isn't needed.SofascorePlayer.career_statstype annotation frompd.DataFrametopd.DataFrame | Noneto reflect the new possible value.test_scrape_player_detailsto assertcareer_statsis apd.DataFrameby default andNonewheninclude_career_stats=False.scrape_team_league_statswhereteam_row(typedpd.Series) was reassigned to apd.DataFrame— renamed toteam_row_df.tox.inienvlist andpyproject.tomlclassifiers.pandas.DataFrametonitpick_ignoreindocs/source/conf.pyto fix a sphinx docs build failure caused by the new union type annotation.Test plan
All tox environments were run locally and passed:
python -m tox -r -e typecheckpython -m tox -r -e lintpython -m tox -r -e docspython -m tox -r -e buildpython -m tox -r -e py314(full test suite against live Sofascore API)