Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
jond01 committed Sep 11, 2024
1 parent 368fc69 commit 81d2fb0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions storey/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import traceback
import uuid
from io import StringIO
from typing import Any, Callable, List, Optional, Tuple, Union
from typing import TYPE_CHECKING, Any, Callable, List, Optional, Tuple, Union
from urllib.parse import urlparse

import pandas as pd
Expand All @@ -38,6 +38,9 @@
from .table import Table, _PersistJob
from .utils import stringify_key, url_to_file_system, wrap_event_for_serialization

if TYPE_CHECKING:
import taosws


class _Writer:
def __init__(
Expand Down Expand Up @@ -978,7 +981,10 @@ def _raw_value_to_value(value):
def _get_batch_values(
cls, reg_cols_schema: list[tuple[str, Callable[[list], "taosws.PyColumnView"]]], batch: list[dict]
) -> list:
return [col_func([cls._raw_value_to_value(event.get(col_name)) for event in batch]) for col_name, col_func in reg_cols_schema]
return [
col_func([cls._raw_value_to_value(event.get(col_name)) for event in batch])
for col_name, col_func in reg_cols_schema
]

async def _emit(self, batch: list[dict], batch_key: str, batch_time, batch_events, last_event_time=None):
tags_schema, reg_cols_schema = self._get_table_schema(self._table or self._supertable)
Expand Down

0 comments on commit 81d2fb0

Please sign in to comment.