Skip to content

Commit

Permalink
Call _convert_stream_to_dict_format in commands instead of in API fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
davitmamrikishvili committed Nov 29, 2024
1 parent d16a93a commit 3e2aa84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,5 @@ BugFixes without ticket

## BugFixes
1. [TH2-5222] - Fix `DownloadMessagesByPageGzip`, it constructed `DownloadMessagesByPageByGroupsGzip` incorrectly.
2. [TH2-5243] - Fix backward compatibility issues with `GetMessagesByBookByGroups` and `GetMessagesByPageByGroups`.
2. [TH2-5243] - Fix backward compatibility issues with `GetMessagesByBookByGroups` and `GetMessagesByPageByGroups`,
added 'limit' and 'search_direction' parameters to 'post_download_messages'.
10 changes: 5 additions & 5 deletions th2_data_services/data_source/lwdp/commands/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from th2_data_services.data_source.lwdp.interfaces.command import IHTTPCommand
from th2_data_services.data_source.lwdp.data_source.http import DataSource
from th2_data_services.data_source.lwdp.source_api.http import API
from th2_data_services.data_source.lwdp.streams import Streams, Stream
from th2_data_services.data_source.lwdp.streams import Streams, Stream, _convert_stream_to_dict_format
from th2_data_services.utils.sse_client import SSEClient
from th2_data_services.data_source.lwdp.adapters.adapter_sse import (
SSEAdapter,
Expand Down Expand Up @@ -1533,7 +1533,7 @@ def __init__(
self._page = page
self._book_id = book_id
self._groups = groups
self._streams = streams
self._streams = _convert_stream_to_dict_format(streams)
self._sort = sort
self._response_formats = response_formats
self._fast_fail = fast_fail
Expand Down Expand Up @@ -1661,7 +1661,7 @@ def __init__(
if isinstance(end_timestamp, int):
self._end_timestamp = UnixTimestampConverter.to_nanoseconds(end_timestamp)
self._groups = groups
self._streams = streams
self._streams = _convert_stream_to_dict_format(streams)
self._sort = sort
self._response_formats = response_formats
self._book_id = book_id
Expand Down Expand Up @@ -1870,7 +1870,7 @@ def __init__(
if isinstance(end_timestamp, int):
self._end_timestamp = UnixTimestampConverter.to_nanoseconds(end_timestamp)
self._groups = groups
self._streams = streams
self._streams = _convert_stream_to_dict_format(streams)
self._sort = sort
self._response_formats = response_formats
self._book_id = book_id
Expand Down Expand Up @@ -2359,7 +2359,7 @@ def __init__(
self._page = page
self._book_id = book_id
self._groups = groups
self._streams = streams
self._streams = _convert_stream_to_dict_format(streams)
self._sort = sort
self._response_formats = response_formats
self._fast_fail = fast_fail
Expand Down
2 changes: 0 additions & 2 deletions th2_data_services/data_source/lwdp/source_api/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ def post_download_messages(
URL for downloading messages and dictionary for request body.
"""

streams = _convert_stream_to_dict_format(streams)

kwargs = {
"resource": "MESSAGES",
"startTimestamp": start_timestamp,
Expand Down

0 comments on commit 3e2aa84

Please sign in to comment.