Skip to content

Commit

Permalink
data.py: read() - remove workaround for fixed sdv bug 1039.
Browse files Browse the repository at this point in the history
  see sdv-dev/SDV#1039, fixed in sdv-1.0beta.
  • Loading branch information
TimJohann committed May 8, 2023
1 parent 92d5dc7 commit 8b3d519
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ASyH/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def sdv_metadata(self) -> SingleTableMetadata:
return SingleTableMetadata.load_from_dict(self._metadata.metadata)

def __init__(self, data: Optional[DataFrame] = None, metadata: Optional[Metadata] = None):
# should we not .copy() the dataframe? atm we do not manipulate ._data.
self._data = data
self._metadata = metadata

Expand All @@ -49,11 +50,9 @@ def read(self, input_file):
x = re.compile(".*Excel.*")
c = re.compile(".*CSV.*")
if x.match(filetype):
# rounding the input to work around
# https://github.com/sdv-dev/SDV/issues/1039
data = pandas.read_excel(input_file).round(decimals=14)
data = pandas.read_excel(input_file)
elif c.match(filetype):
data = pandas.read_csv(input_file).round(decimals=14)
data = pandas.read_csv(input_file)
else:
raise DataError("Cannot determine input file type: ")
self._data = data
Expand Down

0 comments on commit 8b3d519

Please sign in to comment.