-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Avoid type coercion when converting pandas dataframes to agate t…
…ables in the dbt adapter (#2897)
- Loading branch information
1 parent
04db61e
commit 4f1d735
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from __future__ import annotations | ||
|
||
import pandas as pd | ||
from sqlmesh.dbt.util import pandas_to_agate | ||
|
||
|
||
def test_pandas_to_agate_type_coercion(): | ||
df = pd.DataFrame({"data": ["_2024_01_01", "_2024_01_02", "_2024_01_03"]}) | ||
agate_rows = pandas_to_agate(df).rows | ||
|
||
values = [v[0] for v in agate_rows.values()] | ||
assert values == ["_2024_01_01", "_2024_01_02", "_2024_01_03"] |