-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Issue422 replace print with logging #543
Changes from 4 commits
d2e8b37
b5a5e31
c02f3f7
c6a7d71
04019f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
""" | ||
|
||
from data_validation import consts | ||
import logging | ||
|
||
|
||
class TextResultHandler(object): | ||
|
@@ -36,11 +37,11 @@ def print_formatted_(self, result_df): | |
:param result_df | ||
""" | ||
if self.format == "text": | ||
print(result_df.to_string(index=False)) | ||
logging.info(result_df.to_string(index=False)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the logging change the nature of this printing (newlines might either split into new logs or be less exportable) I think printing might be more logical here, but we need to maintain the ability to export into a file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think logging would split into new logs if it has \n in it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It something I've seen in stackdriver specifically. In any case, I'm more worried that you are changing the actual output here since this option is requesting a specific type to be output. CSV and json data would no longer be valid, so anyone piping these out to files would start seeing differences. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense! Will update it |
||
elif self.format == "csv": | ||
print(result_df.to_csv(index=False)) | ||
logging.info(result_df.to_csv(index=False)) | ||
elif self.format == "json": | ||
print(result_df.to_json(orient="index")) | ||
logging.info(result_df.to_json(orient="index")) | ||
else: | ||
print( | ||
result_df.drop(self.cols_filter_list, axis=1).to_markdown( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these seem like error logs