Skip to content

Conversation

@delmarrerikaine
Copy link
Contributor

This PR introduces fix for error with yahoo source that started recently.

The error reproduce

Run in console:
bean-price -d 2025-02-20 -e USD:yahoo/AAPL
which fails with error, while the
bean-price -e USD:yahoo/AAPL
works successfully

Root cause

User-Agent behavior is different for beanprice.sources.yahoo.get_latest_price which works, and beanprice.sources.yahoo.get_historical_price

The changes

  • Unification of session initialization with get_latest_price-like configuration.
  • Unit tests adapted to the change
  • Fixed skipped test_get_latest_price unit test

I have tried to provide minimal working solution in this PR, happy to adapt if more changes required.

@xuhcc
Copy link
Collaborator

xuhcc commented Feb 23, 2025

Does this PR address the same issue as #101 by @rizaon ?

@delmarrerikaine
Copy link
Contributor Author

Yes, issue description for #101 matches my experience.

@rizaon
Copy link

rizaon commented Feb 23, 2025

This PR is more complete than mine. Please go ahead with this one if this passes the tests.

@xuhcc xuhcc merged commit 7a6efa7 into beancount:master Feb 25, 2025
1 check passed
@xuhcc
Copy link
Collaborator

xuhcc commented Feb 25, 2025

Thanks @delmarrerikaine @rizaon !
I will close the other one.

@delmarrerikaine delmarrerikaine deleted the yahoo-reuse-session branch February 25, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants