Skip to content
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

TypeError unsupported operand types for URL and str #229

Closed
2 tasks done
samueleishion opened this issue Apr 24, 2020 · 8 comments · Fixed by #230
Closed
2 tasks done

TypeError unsupported operand types for URL and str #229

samueleishion opened this issue Apr 24, 2020 · 8 comments · Fixed by #230
Labels

Comments

@samueleishion
Copy link
Contributor

Checklist

  • I am on the latest pyrh version.
  • I have searched the issues of this repo and believe that this is not a duplicate.

Description

pyrh fails to return a result when calling function get_historical_quotes

Steps/Code to Reproduce

stock = 'MSFT'
history = robinhood.get_historical_quotes(stock, '5minute', 'week')

Results

Expected: historical data
Actual: Error on the following line (https://github.com/robinhood-unofficial/pyrh/blob/master/pyrh/robinhood.py#L197) that reads

TypeError: unsupported operand type(s) for +: 'URL' and 'str'

Screen Shot 2020-04-23 at 11 10 14 PM

Versions

>>> import platform; print(platform.platform())
Darwin-19.2.0-x86_64-i386-64bit
>>> import sys; print("Python", sys.version)
Python 3.7.6 (default, Dec 30 2019, 19:38:26) 
[Clang 11.0.0 (clang-1100.0.33.16)]
>>> import pyrh; print("pyrh", pyrh.__version__)
pyrh 2.0
@adithyabsk
Copy link
Member

@samueleishion That likely is a bug, we're in the middle of major re-factor and contributions are welcome.

@samueleishion
Copy link
Contributor Author

Suggested change: Replace these lines https://github.com/robinhood-unofficial/pyrh/blob/master/pyrh/robinhood.py#L188-L198 with the following:

historicals = (urls.HISTORICALS.with_query([
        ('symbols', ",".join(stock).upper()),
        ('interval', interval),
        ('span', span),
        ('bounds', bounds.name.lower())
]))

@samueleishion
Copy link
Contributor Author

@adithyabsk just saw your reply... are you taking PRs?

@adithyabsk
Copy link
Member

@samueleishion yep

@samueleishion
Copy link
Contributor Author

@adithyabsk branch off and into master?

@adithyabsk
Copy link
Member

Yep, just fork the project and commit to master and create a PR (so you're not blocked)

samueleishion added a commit to samueleishion/pyrh that referenced this issue Apr 24, 2020
samueleishion added a commit to samueleishion/pyrh that referenced this issue Apr 24, 2020
samueleishion added a commit to samueleishion/pyrh that referenced this issue Apr 24, 2020
@samueleishion
Copy link
Contributor Author

Hey @adithyabsk I've created a PR but it seems to fail when running on Python 3.7.6 with a relatively vague error... any thoughts?
#230

@adithyabsk
Copy link
Member

@samueleishion I commented on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants