You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add sequence rows to upload queue. Mirrors implementation of SequenceApi.insert. Inserted rows will be
cached until uploaded
Args:
rows: The rows to be inserted. Can either be a list of tuples, a list of ["rownumber": ..., "values": ...]
objects, a dictionary of rowNumber: data, or a SequenceData object.
column_external_ids: List of external id for the columns of the sequence
id: Sequence internal ID
Use if external_id is None
external_id: Sequence external ID
Us if id is None
"""
The parameter description states:
column_external_ids: List of external id for the columns of the sequence
But the parameter takes in:
column_external_ids: Optional[List[dict]] = None
As opposed to a List[str]. It then will try to plug it into the columns parameter SequenceData(id=id, external_id=id, rows=rows, columns=column_external_ids) which will later result in error:
return [cast(str, c.get("externalId")) for c in self.columns]
Change the parameter for add_to_upload_queue from column_external_ids to columns but that will change the look and feel. The SDK feel is to insert a list of str as column_external_ids.
Keep it as column_external_ids and in add_to_upload_queue, generate the API like dict for columns from the list of str column_external_ids.
Within the SequenceUploadQueue, there is a function set_sequence_column_definition that sets self.column_definitions but it isn't used unless a create is being called. It feels super odd when you want to create on missing Sequences and call set_sequence_column_definition with column definitions, but when calling add_to_upload_queue, you must additionally add column definitions again.
The text was updated successfully, but these errors were encountered:
python-extractor-utils/cognite/extractorutils/uploader/time_series.py
Lines 428 to 452 in 3e99e07
The parameter description states:
column_external_ids: List of external id for the columns of the sequence
But the parameter takes in:
column_external_ids: Optional[List[dict]] = None
As opposed to a List[str]. It then will try to plug it into the
columns
parameter SequenceData(id=id, external_id=id, rows=rows, columns=column_external_ids) which will later result in error:SequenceData is expecting an API like dict for columns:
https://docs.cognite.com/api/v1/#tag/Sequences/operation/createSequence
Possible options:
add_to_upload_queue
fromcolumn_external_ids
tocolumns
but that will change the look and feel. The SDK feel is to insert a list of str ascolumn_external_ids
.column_external_ids
and inadd_to_upload_queue
, generate the API like dict for columns from the list of strcolumn_external_ids
.set_sequence_column_definition
that setsself.column_definitions
but it isn't used unless a create is being called. It feels super odd when you want to create on missing Sequences and callset_sequence_column_definition
with column definitions, but when callingadd_to_upload_queue
, you must additionally add column definitions again.The text was updated successfully, but these errors were encountered: