mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-30 14:12:28 +00:00
Skip building a ROW_TYPE when building updates
We're about to turn it straight into a JSON object anyway so building a ROW_TYPE is a bit pointless, and reduces flexibility in the update_function.
This commit is contained in:
parent
f570916a3e
commit
015b3622eb
@ -112,7 +112,7 @@ class Stream(object):
|
|||||||
time it was called up until the point `advance_current_token` was called.
|
time it was called up until the point `advance_current_token` was called.
|
||||||
"""
|
"""
|
||||||
NAME = None # The name of the stream
|
NAME = None # The name of the stream
|
||||||
ROW_TYPE = None # The type of the row
|
ROW_TYPE = None # The type of the row. Used by the default impl of parse_row.
|
||||||
_LIMITED = True # Whether the update function takes a limit
|
_LIMITED = True # Whether the update function takes a limit
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -201,7 +201,7 @@ class Stream(object):
|
|||||||
from_token, current_token,
|
from_token, current_token,
|
||||||
)
|
)
|
||||||
|
|
||||||
updates = [(row[0], self.ROW_TYPE(*row[1:])) for row in rows]
|
updates = [(row[0], row[1:]) for row in rows]
|
||||||
|
|
||||||
# check we didn't get more rows than the limit.
|
# check we didn't get more rows than the limit.
|
||||||
# doing it like this allows the update_function to be a generator.
|
# doing it like this allows the update_function to be a generator.
|
||||||
|
Loading…
Reference in New Issue
Block a user