alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
537 stars 134 forks source link

fixing an issue where using f-strings uses the enum name instead of t… #378

Closed gageorsburn closed 9 months ago

gageorsburn commented 9 months ago

…he enum value

exception hit in prod: requests.exceptions.MissingSchema: Invalid URL 'BaseURL.BROKER_PRODUCTION/v1/accounts/XXXX-69da-44c2-bf62-37b29a9a2063/documents/XXXX-af19-45c1-8ad5-4313582caab0/download': No scheme supplied. Perhaps you meant https://BaseURL.BROKER_PRODUCTION/v1/accounts/XXXX-69da-44c2-bf62-37b29a9a2063/documents/XXXX-af19-45c1-8ad5-4313582caab0/download?

the behavior is like this:

(Pdb) self._base_url + "foo"
'https://broker-api.alpaca.marketsfoo/'
(Pdb) f"{self._base_url}"
'BaseURL.BROKER_PRODUCTION'
gageorsburn commented 9 months ago

@hiohiohio any chance I could get a review :)?