data-linter 6.3.0__tar.gz → 6.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: data_linter
3
- Version: 6.3.0
3
+ Version: 6.3.2
4
4
  Summary: data linter
5
5
  Author: Thomas Hirsch
6
6
  Author-email: thomas.hirsch@digital.justice.gov.uk
@@ -0,0 +1 @@
1
+ __version__ = "6.3.2"
@@ -43,7 +43,7 @@ from data_linter.utils import (
43
43
  get_filepaths_from_local_folder,
44
44
  local_file_to_s3,
45
45
  read_all_file_body,
46
- get_file_lengths
46
+ get_file_lengths,
47
47
  )
48
48
 
49
49
  from data_linter.validators import (
@@ -439,6 +439,7 @@ def validate_data(config: dict) -> ValidatorResult:
439
439
  else:
440
440
  msg4 = f"SKIPPING {table_name}. No files found."
441
441
  log.info(msg4)
442
+ return None
442
443
 
443
444
  if all_table_responses:
444
445
  save_completion_status(config, all_table_responses)
@@ -469,8 +469,10 @@ def _parse_data_to_pandas(filepath: str, table_params: dict, metadata: Metadata)
469
469
  raise ColumnError(err_msg)
470
470
 
471
471
  # sample the data, if required
472
- if table_params.get("row-limit"):
473
- df = df.sample(table_params.get("row-limit"))
472
+ row_limit = table_params.get("row-limit", None)
473
+ if row_limit:
474
+ row_limit = row_limit if row_limit <= len(df) else len(df)
475
+ df = df.sample(row_limit)
474
476
 
475
477
  if metadata.file_format not in ["parquet", "snappy.parquet"]:
476
478
  df = cast_pandas_table_to_schema(df, metadata)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "data_linter"
3
- version = "6.3.0"
3
+ version = "6.3.2"
4
4
  description = "data linter"
5
5
  authors = ["Thomas Hirsch <thomas.hirsch@digital.justice.gov.uk>",
6
6
  "George Kelly <george.kelly@digital.justice.gov.uk>",
@@ -1 +0,0 @@
1
- __version__ = "6.3.0"
File without changes