Skip to content

Commit d6ea47a

Browse files
author
Matteo Hoch
committed
Minor bugfix
1 parent d8a4079 commit d6ea47a

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

sdd_api/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def __init__(self,username=None, password=None, client_id=None, client_secret=No
3131
raise ApiInitializationException("Please supply username, password, client_id, and client_secret params or pass a file")
3232
if server_url:
3333
self.SERVER_URL = server_url
34+
else:
35+
self.SERVER_URL = SERVER_URL
3436
self.verify=verify
3537
self.gen_token()
3638

@@ -49,10 +51,8 @@ def get_json(self, table_name, schema_name="nfl", season_start=None, season_stop
4951
else:
5052
return d
5153

52-
def get_dataframe(self, table_name, schema_name="nfl", season_start=2017, season_stop=None, progress_bar=False):
54+
def get_dataframe(self, table_name, schema_name="nfl", season_start=2017, season_stop=2017, progress_bar=True):
5355
df=pd.DataFrame()
54-
if season_stop is None:
55-
season_stop=2017
5656

5757
seasons=range(season_start, season_stop+1)
5858
if progress_bar:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
setup(
1111
name = 'sdd_api',
1212
packages = ['sdd_api'], # this must be the same as the name above
13-
version = '0.2.0',
13+
version = '0.2.1',
1414
description = 'Python API for Sports Data Direct',
1515
author = 'Sports Data Direct',
1616
author_email = 'admin@sportsdatadirect.com',

tests/critical_tests.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
api = Api(username=username, password=password, client_id=client_id, client_secret=client_secret, server_url="https://localhost", verify=False)
1515
class TestConfig(unittest.TestCase):
1616
def test_config(self):
17-
df = api.get_dataframe("drives")
18-
assert type(df), pd.DataFrame
19-
def test_players(self):
20-
df = api.get_dataframe("player_game_logs", season_start=2011)
21-
print(df.sample(10))
17+
df = api.get_dataframe("matchups",season_start=2016)
18+
assert len(df),len(df.drop_duplicates())
19+
# df = api.get_dataframe("drives")
20+
# assert type(df), pd.DataFrame
21+
# def test_players(self):
22+
# df = api.get_dataframe("matchups", season_start=2016)
23+
# print(df.sample(10))
24+
# def no_duplicates(self):
25+
# df = api.get_dataframe("matchups",season_start=2016)
26+
# assert len(df),len(df.drop_duplicates())
2227

2328
if __name__ == '__main__':
2429
unittest.main()

tests/test_credentials.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)