Skip to content

Commit

Permalink
fix: Better detection of Oracle client (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
nj1973 committed Feb 21, 2023
1 parent b1141de commit efce0b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion data_validation/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,16 @@ def build_config_calculated_fields(
def _strftime_format(
self, column_type: Union[dt.Date, dt.Timestamp], client
) -> str:
def is_oracle_client(client):
# When no Oracle client installed clients.OracleClient is not a class
try:
return isinstance(client, clients.OracleClient)
except TypeError:
return False

if isinstance(column_type, dt.Timestamp):
return "%Y-%m-%d %H:%M:%S"
if isinstance(client, clients.OracleClient):
if is_oracle_client(client):
# Oracle DATE is a DateTime
return "%Y-%m-%d %H:%M:%S"
return "%Y-%m-%d"
Expand Down

0 comments on commit efce0b8

Please sign in to comment.