Skip to content

Commit

Permalink
fix lowercase symbols and improve error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Škoda committed Nov 22, 2023
1 parent 0299784 commit b12fd44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 2,13 @@
History
=======


0.12.1 (2023-11-22)
-------------------

* fix issue !6 with lowercase symbol names
* better error when aws clients use free data sample (!7)

0.12.0 (2023-11-18)
-------------------

Expand Down
7 changes: 6 additions & 1 deletion lakeapi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 136,7 @@ def partition_filter(partition: Dict[str, str]) -> bool:
)

if symbols:
assert symbols[0].upper() == symbols[0]
assert symbols[0].upper() == symbols[0] or symbols[0][5:].upper() == symbols[0][5:]
if exchanges:
assert exchanges[0].upper() == exchanges[0]

Expand Down Expand Up @@ -185,6 185,11 @@ def partition_filter(partition: Dict[str, str]) -> bool:
raise lakeapi.exceptions.NoFilesFound("No data found for your query in the free sample dataset. Please subscribe to access more data.")
else:
raise
except botocore.exceptions.UnauthorizedSSOTokenError as ex:
raise PermissionError(
"It seems you use a AWS account and try to access free data. Try using "
"`use_sample_data(anonymous_access=False)` or read https://github.com/crypto-lake/lake-api/issues/7."
)
else:
# got error 404 both before and after the cache.clear()
raise last_ex
Expand Down

0 comments on commit b12fd44

Please sign in to comment.