Skip to content

Commit

Permalink
Remove offset seconds from OffsetDatetime result (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger authored Sep 16, 2022
1 parent be05a27 commit a27ff8f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flaco"
version = "0.6.0-rc1"
version = "0.6.0-rc2"
edition = "2018"
license = "Unlicense/MIT"

Expand Down
3 changes: 2 additions & 1 deletion benchmarks/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ def memory_profile():
print(type(mytable), len(mytable))
print(type(table), len(table))
print(pa.total_allocated_bytes() >> 20)
breakpoint()
engine = create_engine(DB_URI)
_pandas_df = pd.read_sql(stmt, engine)


if __name__ == "__main__":
#_table_setup(n_rows=1_000_000, include_nulls=True)
_table_setup(n_rows=10_000, include_nulls=False)
memory_profile()
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,13 @@ pub mod postgresql {
)?;
}
&Type::TIMESTAMPTZ => {
let format = time::format_description::parse("[year]-[month]-[day] [hour]:[minute]:[second] [offset_hour sign:mandatory]:[offset_minute]").unwrap();
table
.entry(column_name)
.or_insert_with(|| Column::new(MutableUtf8Array::<i32>::new()))
.push::<_, MutableUtf8Array<i32>>(
row.get::<_, Option<time::OffsetDateTime>>(idx)
.map(|v| v.to_string()),
.map(|v| v.format(&format).unwrap()),
)?;
}
&Type::DATE => {
Expand Down

0 comments on commit a27ff8f

Please sign in to comment.