-
Notifications
You must be signed in to change notification settings - Fork 213
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
Basketball League Transactions #598
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #598 +/- ##
==========================================
- Coverage 83.98% 83.18% -0.80%
==========================================
Files 60 61 +1
Lines 2254 2290 +36
==========================================
+ Hits 1893 1905 +12
- Misses 361 385 +24 ☔ View full report in Codecov by Sentry. |
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.
Thanks for adding this feature as well. I just have a couple recommendations. Could you also add the transaction types to the constant map
@@ -0,0 +1,7 @@ | |||
class TransactionItem(object): |
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.
this might be better defined in the same file as transactions
espn_api/basketball/league.py
Outdated
'scoringPeriodId': scoring_period, | ||
} | ||
|
||
filters = {"transactions":{"filterType":{"value":["FREEAGENT","WAIVER","WAIVER_ERROR"]}}} |
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 think having these filter types as default is good and then allow it to be passed in to the function as well in case you only want to look for one or different ones.
Thanks for the feedback @cwendt94! Updated accordingly. |
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.
Looks good, thanks for adding this feature!
New method
League.transactions()
uses themTransactions2
view to fetch more detailed transaction data than is available throughrecent_activity
.I'm only fetching free agent and waiver transactions right now because that's the only data I have available to test with in my league, however trades and roster moves are also available. In my testing I got a surprisingly helpful error message that enumerated all available transaction types:
DRAFT, TRADE_ACCEPT, WAIVER, TRADE_VETO, FUTURE_ROSTER, ROSTER, RETRO_ROSTER, TRADE_PROPOSAL, TRADE_UPHOLD, FREEAGENT, TRADE_DECLINE, WAIVER_ERROR, TRADE_ERROR