Skip to content

Commit

Permalink
Removed psutiling
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadam14 committed Oct 22, 2024
1 parent 8881727 commit 640d2ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/regtech_data_validator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ def validate(
print(df_to_table(final_df))
case OutputFormat.DOWNLOAD:
df_to_download(final_df)
print(f"Final DF Height: {final_df.height}")
print(f"Took {(datetime.now() - start).total_seconds()} seconds")
case _:
raise ValueError(f'output format "{output}" not supported')

Expand Down
10 changes: 3 additions & 7 deletions src/regtech_data_validator/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def _add_validation_metadata(failed_check_fields_df: pl.DataFrame, check: SBLChe
return validation_fields_df


def validate(schema: pa.DataFrameSchema, submission_df: pl.LazyFrame, row_start: int, process_errors: bool) -> pl.DataFrame:
def validate(
schema: pa.DataFrameSchema, submission_df: pl.LazyFrame, row_start: int, process_errors: bool
) -> pl.DataFrame:
"""
validate received dataframe with schema and return list of
schema errors
Expand Down Expand Up @@ -164,9 +166,6 @@ def validate_batch_csv(
batch_count: int = 1,
max_errors=1000000,
):
from datetime import datetime
import psutil
start = datetime.now()
has_syntax_errors = False
real_path = get_real_file_path(path)
# process the data first looking for syntax (phase 1) errors, then looking for logical (phase 2) errors/warnings
Expand Down Expand Up @@ -205,9 +204,6 @@ def validate_batch_csv(

if os.path.isdir("/tmp/s3"):
shutil.rmtree("/tmp/s3")

print(f"Total time: {(datetime.now() - start).total_seconds()} seconds")
print(f"Total Memory: {psutil.Process(os.getpid()).memory_info().rss / (1024*1024)}MB")


# Reads in a path to a csv in batches, using batch_size to determine number of rows to read into the buffer,
Expand Down

0 comments on commit 640d2ce

Please sign in to comment.