Skip to content

Commit

Permalink
Update lightest.py
Browse files Browse the repository at this point in the history
* Added corrections
  • Loading branch information
jzsmoreno committed Oct 3, 2023
1 parent 0c0624f commit a6473ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 14 additions & 3 deletions pydbsmgr/lightest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@ def clean_frame(self) -> DataFrame:
else:
table[cols[column_index]] = table[cols[column_index]].apply(clean)
table[cols[column_index]] = table[cols[column_index]].apply(remove_char)
table[cols[column_index]] = table[cols[column_index]].apply(
lambda text: text.title()
)
try:
table[cols[column_index]] = table[cols[column_index]].apply(
lambda text: text.title()
)
except AttributeError as e:
warning_type = "UserWarning"
msg = (
"It was not possible to perform the cleaning, the column {%s} is duplicated. "
% cols[column_index]
)
msg += "Error: {%s}" % e
print(f"{warning_type}: {msg}")
sys.exit("Perform correction manually")

table[cols[column_index]] = table[cols[column_index]].apply(
self._correct_str, datatype=datatype
)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pydbsmgr",
version="0.5.0",
version="0.5.1",
author="J. A. Moreno-Guerra",
author_email="[email protected]",
description="Testing installation of Package",
Expand All @@ -30,6 +30,7 @@
"pyarrow",
"fastparquet",
"loguru",
"psutil",
],
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit a6473ba

Please sign in to comment.