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

Fix release_time query to match python hub. #41

Merged
merged 2 commits into from
Aug 3, 2022

Conversation

moodyjon
Copy link
Contributor

Fixes #40

Primary purpose is to adjust the query to match Python claim search:
https://github.com/lbryio/hub/blob/eb87474b480f77cd2849156136101f642202fed3/hub/common.py#L603

Also contains some changes to GetProdDB to avoid panic when DB is not found. Can be unbundled if desired.

Still struggling to run tests locally (MacOS) to prove the fix is sufficient to make test_setting_stream_fields pass.

@moodyjon
Copy link
Contributor Author

I successfully ran the testcase (test_setting_stream_fields) in both LEGACY and non-LEGACY modes.

(lbry-venv-3.9) Mac-mini lbry-sdk % env ENABLE_LEGACY_SEARCH=1 python -m unittest -vv -k test_setting_stream_fields tests/integration/claims/test_claim_commands.py
test_setting_stream_fields (tests.integration.claims.test_claim_commands.StreamCommands) ... 2022-07-29 12:39:02,959 - hub.env - WARNING - lowered maximum sessions from 1,000 to 0 because your open file limit is 256
2022-07-29 12:39:04,669 - asyncio - WARNING - Executing <Task pending name='Task-1' coro=<CommandTestCase.asyncSetUp() running at /Users/swdev1/lbry-sdk/lbry/testcase.py:407> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x109ce2dc0>()] created at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:429> cb=[_run_until_complete_cb() at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:184] created at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:626> took 1.730 seconds
2022-07-29 12:39:09,256 - elasticsearch - WARNING - GET http://localhost:9200/_template/1fabcf2cbeb746a0af0390480b0524d3claims [status:404 request:0.020s]
/Users/swdev1/hub/hub/herald/session.py:595: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait([
/Users/swdev1/lbry-sdk/lbry/wallet/ledger.py:332: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait([
/Users/swdev1/lbry-sdk/lbry/wallet/network.py:317: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait(
/Users/swdev1/lbry-sdk/lbry/wallet/network.py:343: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait(
/Users/swdev1/lbry-sdk/lbry/wallet/ledger.py:469: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait([
/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/events.py:80: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  self._context.run(self._callback, *self._args)
/Users/swdev1/lbry-sdk/lbry/extras/daemon/storage.py:796: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait(update_file_callbacks)
ok

----------------------------------------------------------------------
Ran 1 test in 46.841s

OK
(lbry-venv-3.9) Mac-mini lbry-sdk % env ENABLE_LEGACY_SEARCH=0 python -m unittest -vv -k test_setting_stream_fields tests/integration/claims/test_claim_commands.py
test_setting_stream_fields (tests.integration.claims.test_claim_commands.StreamCommands) ... 2022-07-29 12:39:59,761 - hub.env - WARNING - lowered maximum sessions from 1,000 to 0 because your open file limit is 256
2022-07-29 12:40:01,528 - asyncio - WARNING - Executing <Task pending name='Task-1' coro=<CommandTestCase.asyncSetUp() running at /Users/swdev1/lbry-sdk/lbry/testcase.py:407> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x106a7ec70>()] created at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:429> cb=[_run_until_complete_cb() at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:184] created at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:626> took 1.787 seconds
2022-07-29 12:40:06,052 - elasticsearch - WARNING - GET http://localhost:9200/_template/4379ce36e0bc4643b63f7570f313b947claims [status:404 request:0.011s]
/Users/swdev1/hub/hub/herald/session.py:595: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait([
/Users/swdev1/lbry-sdk/lbry/wallet/ledger.py:332: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait([
/Users/swdev1/lbry-sdk/lbry/wallet/network.py:317: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait(
/Users/swdev1/lbry-sdk/lbry/wallet/network.py:343: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait(
/Users/swdev1/lbry-sdk/lbry/wallet/ledger.py:469: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait([
/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/events.py:80: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  self._context.run(self._callback, *self._args)
/Users/swdev1/lbry-sdk/lbry/extras/daemon/storage.py:796: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
  await asyncio.wait(update_file_callbacks)
2022-07-29 12:40:36,984 - asyncio - WARNING - Executing <Task pending name='Task-2865' coro=<Ledger.stop() running at /Users/swdev1/lbry-sdk/lbry/wallet/ledger.py:366> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x106d15610>()] created at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:429> cb=[_gather.<locals>._done_callback() at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py:767] created at /opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py:829> took 0.744 seconds
ok

----------------------------------------------------------------------
Ran 1 test in 48.693s

OK

@jeffreypicard jeffreypicard merged commit 49e5d7b into lbryio:master Aug 3, 2022
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.

missing claim search entries - release_time range query
3 participants