Sitelet https://github.com/feast-dev/feast/pull/6779/files
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions docs/how-to-guides/feature-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ Monitoring works natively with all offline stores that serve as compute engines
| BigQuery | SQL push-down | `MERGE` into BQ tables |
| Redshift | SQL push-down | `MERGE` via Data API |
| Spark | SparkSQL push-down | Parquet tables |
| Trino | SQL push-down | Trino tables |
| Oracle | SQL via Ibis | `MERGE` from `DUAL` |
| DuckDB | In-memory SQL | Parquet files |
| Dask | PyArrow compute | Parquet files |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
```
"""

from datetime import datetime, timezone
from datetime import date, datetime, timezone
from typing import Any, Dict, Iterator, Optional, Set

import numpy as np
Expand Down Expand Up @@ -117,20 +117,27 @@ def _is_nan(value: Any) -> bool:
def _format_value(row: pd.Series, schema: Dict[str, Any]) -> str:
formated_values = []
for row_name, row_value in row.items():
if schema[row_name].startswith("timestamp"):
if _is_nan(row_value):
formated_values.append("NULL")
elif schema[row_name].startswith("timestamp"):
if isinstance(row_value, datetime):
row_value = format_datetime(row_value)
formated_values.append(f"TIMESTAMP '{row_value}'")
elif schema[row_name].startswith("date"):
if isinstance(row_value, (datetime, date)):
row_value = row_value.strftime("%Y-%m-%d")
formated_values.append(f"DATE '{row_value}'")
elif isinstance(row_value, (bool, np.bool_)):
formated_values.append("TRUE" if row_value else "FALSE")
elif isinstance(row_value, list):
formated_values.append(f"ARRAY{row_value}")
elif isinstance(row_value, np.ndarray):
formated_values.append(f"ARRAY{row_value.tolist()}")
elif isinstance(row_value, tuple):
formated_values.append(f"ARRAY{list(row_value)}")
elif isinstance(row_value, str):
formated_values.append(f"'{row_value}'")
elif _is_nan(row_value):
formated_values.append("NULL")
escaped = row_value.replace("'", "''")
formated_values.append(f"'{escaped}'")
else:
formated_values.append(f"{row_value}")

Expand Down
Loading
Loading