Skip to content

Commit 2921077

Browse files
authored
Merge branch 'sfu-db:main' into libgssapi
2 parents c73524e + 5e15d02 commit 2921077

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

connectorx-python/src/pandas/transports/oracle.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::errors::ConnectorXPythonError;
22
use crate::pandas::destination::PandasDestination;
33
use crate::pandas::typesystem::PandasTypeSystem;
4-
use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc};
4+
use chrono::{DateTime, NaiveDateTime, Utc};
55
use connectorx::{
66
impl_transport,
77
sources::oracle::{OracleSource, OracleTypeSystem},
@@ -27,18 +27,12 @@ impl_transport!(
2727
{ Char[String] => String[String] | conversion none }
2828
{ NVarChar[String] => String[String] | conversion none }
2929
{ NChar[String] => String[String] | conversion none }
30-
{ Date[NaiveDate] => DateTime[DateTime<Utc>] | conversion option }
31-
{ Timestamp[NaiveDateTime] => DateTime[DateTime<Utc>] | conversion option }
30+
{ Date[NaiveDateTime] => DateTime[DateTime<Utc>] | conversion option }
31+
{ Timestamp[NaiveDateTime] => DateTime[DateTime<Utc>] | conversion none }
3232
{ TimestampTz[DateTime<Utc>] => DateTime[DateTime<Utc>] | conversion auto }
3333
}
3434
);
3535

36-
impl<'py> TypeConversion<NaiveDate, DateTime<Utc>> for OraclePandasTransport<'py> {
37-
fn convert(val: NaiveDate) -> DateTime<Utc> {
38-
DateTime::from_utc(val.and_hms(0, 0, 0), Utc)
39-
}
40-
}
41-
4236
impl<'py> TypeConversion<NaiveDateTime, DateTime<Utc>> for OraclePandasTransport<'py> {
4337
fn convert(val: NaiveDateTime) -> DateTime<Utc> {
4438
DateTime::from_utc(val, Utc)

connectorx/src/sources/mysql/typesystem.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ impl<'a> From<(&'a ColumnType, &'a ColumnFlags)> for MySQLTypeSystem {
115115
ColumnType::MYSQL_TYPE_MEDIUM_BLOB => MediumBlob(null_ok),
116116
ColumnType::MYSQL_TYPE_LONG_BLOB => LongBlob(null_ok),
117117
ColumnType::MYSQL_TYPE_JSON => Json(null_ok),
118+
ColumnType::MYSQL_TYPE_VARCHAR => VarChar(null_ok),
118119
_ => unimplemented!("{}", format!("{:?}", ty)),
119120
}
120121
}

connectorx/src/sources/oracle/typesystem.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc};
1+
use chrono::{DateTime, NaiveDateTime, Utc};
22
use r2d2_oracle::oracle::sql_type::OracleType;
33

44
#[derive(Copy, Clone, Debug)]
@@ -26,8 +26,7 @@ impl_typesystem! {
2626
{ Float | NumFloat | BinaryFloat | BinaryDouble => f64 }
2727
{ Blob => Vec<u8>}
2828
{ Clob | VarChar | Char | NVarChar | NChar => String }
29-
{ Date => NaiveDate }
30-
{ Timestamp => NaiveDateTime }
29+
{ Date | Timestamp => NaiveDateTime }
3130
{ TimestampTz => DateTime<Utc> }
3231
}
3332
}

connectorx/src/transports/oracle_arrow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
sources::oracle::{OracleSource, OracleSourceError, OracleTypeSystem},
55
typesystem::TypeConversion,
66
};
7-
use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc};
7+
use chrono::{DateTime, NaiveDateTime, Utc};
88
use thiserror::Error;
99

1010
#[derive(Error, Debug)]
@@ -38,8 +38,8 @@ impl_transport!(
3838
{ Char[String] => LargeUtf8[String] | conversion none }
3939
{ NVarChar[String] => LargeUtf8[String] | conversion none }
4040
{ NChar[String] => LargeUtf8[String] | conversion none }
41-
{ Date[NaiveDate] => Date32[NaiveDate] | conversion auto }
42-
{ Timestamp[NaiveDateTime] => Date64[NaiveDateTime] | conversion auto }
41+
{ Date[NaiveDateTime] => Date64[NaiveDateTime] | conversion auto }
42+
{ Timestamp[NaiveDateTime] => Date64[NaiveDateTime] | conversion none }
4343
{ TimestampTz[DateTime<Utc>] => DateTimeTz[DateTime<Utc>] | conversion auto }
4444
}
4545
);

connectorx/src/transports/oracle_arrow2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
sources::oracle::{OracleSource, OracleSourceError, OracleTypeSystem},
77
typesystem::TypeConversion,
88
};
9-
use chrono::{DateTime, NaiveDate, NaiveDateTime, Utc};
9+
use chrono::{DateTime, NaiveDateTime, Utc};
1010
use thiserror::Error;
1111

1212
#[derive(Error, Debug)]
@@ -40,8 +40,8 @@ impl_transport!(
4040
{ Char[String] => LargeUtf8[String] | conversion none }
4141
{ NVarChar[String] => LargeUtf8[String] | conversion none }
4242
{ NChar[String] => LargeUtf8[String] | conversion none }
43-
{ Date[NaiveDate] => Date32[NaiveDate] | conversion auto }
44-
{ Timestamp[NaiveDateTime] => Date64[NaiveDateTime] | conversion auto }
43+
{ Date[NaiveDateTime] => Date64[NaiveDateTime] | conversion auto }
44+
{ Timestamp[NaiveDateTime] => Date64[NaiveDateTime] | conversion none }
4545
{ TimestampTz[DateTime<Utc>] => DateTimeTz[DateTime<Utc>] | conversion auto }
4646
}
4747
);

0 commit comments

Comments
 (0)