Fix release_time query to match python hub. #41

Merged
moodyjon merged 2 commits from release_time_query into master 2022-08-03 18:19:26 +02:00
moodyjon commented 2022-07-29 16:52:44 +02:00 (Migrated from github.com)

Fixes https://github.com/lbryio/herald/issues/40

Primary purpose is to adjust the query to match Python claim search:
eb87474b48/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.

Fixes https://github.com/lbryio/herald/issues/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.
jackrobison (Migrated from github.com) reviewed 2022-07-29 16:52:44 +02:00
moodyjon commented 2022-07-29 18:47:05 +02:00 (Migrated from github.com)

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/python@3.9/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/python@3.9/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/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:184] created at /opt/homebrew/Cellar/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:184] created at /opt/homebrew/Cellar/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py:767] created at /opt/homebrew/Cellar/python@3.9/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
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/python@3.9/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/python@3.9/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/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:184] created at /opt/homebrew/Cellar/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py:184] created at /opt/homebrew/Cellar/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/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/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py:767] created at /opt/homebrew/Cellar/python@3.9/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 (Migrated from github.com) approved these changes 2022-08-03 17:07:37 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/herald.go#41
No description provided.