You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading tables using ItsdbProfile.read_table(), it will raise a KeyError for a table not defined in the relations, raise a ItsdbError if the table is defined, but there is no corresponding file, or return a list of rows for a present, defined file (an empty list for an empty file). Furthermore, because files can be plaintext or compressed, to check if a file is present is a bit clunky:
if (os.path.exists(filepath) andos.stat(filepath).st_size>0) or (os.path.exists(filepath+'.gz') andos.stat(filepath+'.gz') >0):
...
These would be more convenient if the ItsdbProfile class had some table_exists() and table_size() (or table_nonempty() or something) methods. In general, the user should not have to manage the filepath and filepath + '.gz' alternations themselves.
The text was updated successfully, but these errors were encountered:
When reading tables using ItsdbProfile.read_table(), it will raise a KeyError for a table not defined in the relations, raise a ItsdbError if the table is defined, but there is no corresponding file, or return a list of rows for a present, defined file (an empty list for an empty file). Furthermore, because files can be plaintext or compressed, to check if a file is present is a bit clunky:
Similarly, to check if the file is non-empty:
These would be more convenient if the ItsdbProfile class had some
table_exists()
andtable_size()
(ortable_nonempty()
or something) methods. In general, the user should not have to manage thefilepath
andfilepath + '.gz'
alternations themselves.The text was updated successfully, but these errors were encountered: