(
client: Client, entity_df: Union[pd.DataFrame, str]
)
| 1426 | |
| 1427 | |
| 1428 | def _get_entity_schema( |
| 1429 | client: Client, entity_df: Union[pd.DataFrame, str] |
| 1430 | ) -> Dict[str, np.dtype]: |
| 1431 | if isinstance(entity_df, str): |
| 1432 | entity_df_sample = ( |
| 1433 | client.query(f"SELECT * FROM ({entity_df}) LIMIT 0").result().to_dataframe() |
| 1434 | ) |
| 1435 | |
| 1436 | entity_schema = dict(zip(entity_df_sample.columns, entity_df_sample.dtypes)) |
| 1437 | elif isinstance(entity_df, pd.DataFrame): |
| 1438 | entity_schema = dict(zip(entity_df.columns, entity_df.dtypes)) |
| 1439 | else: |
| 1440 | raise InvalidEntityType(type(entity_df)) |
| 1441 | |
| 1442 | return entity_schema |
| 1443 | |
| 1444 | |
| 1445 | def _get_entity_df_event_timestamp_range( |
no test coverage detected