FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Add quality monitoring features for Trino offline store by Marcus-Rosti · Pull Request #6779 · feast-dev/feast · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .py  (4) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions docs/how-to-guides/feature-monitoring.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL