Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion faust/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def __init__(
# for the web server.
self._monitor = monitor

# Any additional asyncio.Task's specified using @app.task decorator.
# Any additional asyncio.Tasks specified using @app.task decorator.
self._app_tasks = []

# Called as soon as the a worker is fully operational.
Expand Down Expand Up @@ -1138,6 +1138,7 @@ def Table(
window: Optional[WindowT] = None,
partitions: Optional[int] = None,
help: Optional[str] = None,
value_serializer: str = None, # Add this line
**kwargs: Any,
) -> TableT:
"""Define new table.
Expand Down Expand Up @@ -1169,6 +1170,7 @@ def Table(
beacon=self.tables.beacon,
partitions=partitions,
help=help,
value_serializer=value_serializer, # Add this line
**kwargs,
),
)
Expand Down
5 changes: 3 additions & 2 deletions faust/tables/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def __init__(
on_window_close: Optional[WindowCloseCallback] = None,
is_global: bool = False,
synchronize_all_active_partitions: bool = False,
value_serializer: Optional[CodecArg] = None, # Add this line
**kwargs: Any,
) -> None:
Service.__init__(self, loop=app.loop, **kwargs)
Expand Down Expand Up @@ -157,7 +158,7 @@ def __init__(
# Possible values json and raw
# Fallback to json
self.key_serializer = self._serializer_from_type(self.key_type)
self.value_serializer = self._serializer_from_type(self.value_type)
self.value_serializer = value_serializer # Add this line
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you comment add this line everywhere? seems like a rather invaluable comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment made me remember what I should do. Can I remove these comments if that works for you?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend it as this is not useful anymore IMO

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've removed them.


# Table key expiration
self._partition_timestamp_keys = defaultdict(set)
Expand Down Expand Up @@ -199,7 +200,7 @@ def _new_store_by_url(self, url: Union[str, URL]) -> StoreT:
table_name=self.name,
key_type=self.key_type,
key_serializer=self.key_serializer,
value_serializer=self.value_serializer,
value_serializer=self.value_serializer, # Add this line
value_type=self.value_type,
loop=self.loop,
options=self.options,
Expand Down