Skip to content

Commit

Permalink
#22: Fixed uncaught exception
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Hoffmann <[email protected]>
  • Loading branch information
dh1542 committed Nov 9, 2024
1 parent 9ec9b45 commit c034b31
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import pandas as pd
from databricks.sqlalchemy.test_local.conftest import schema
from exceptiongroup import catch
from pyspark.sql import functions as F
from pyspark.sql import SparkSession
from pyspark.sql import DataFrame
Expand Down Expand Up @@ -87,7 +88,10 @@ def get_time_delta(self) -> timedelta:
raise ValueError("interval_unit must be either 'seconds' or 'milliseconds'")

def format_date_time_to_string(self, time_stamp: pd.Timestamp) -> str:
return time_stamp.strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
try:
return time_stamp.strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
except Exception as e:
raise ValueError(f"Error converting timestamp to string: {e}")

def filter(self) -> DataFrame:
"""
Expand Down

0 comments on commit c034b31

Please sign in to comment.