Skip to content
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

CompoundMessage should not aggregate logs #95

Open
Yancey1989 opened this issue Dec 25, 2019 · 0 comments
Open

CompoundMessage should not aggregate logs #95

Yancey1989 opened this issue Dec 25, 2019 · 0 comments

Comments

@Yancey1989
Copy link
Collaborator

pysqlflow/sqlflow/client.py

Lines 126 to 150 in da0fffd

if first.WhichOneof('response') == 'message':
# if the first line is html tag like,
# merge all return strings then render the html on notebook
if re.match(r'<[a-z][\s\S]*>.*', first.message.message):
resp_list = [first.message.message]
for res in stream_response:
if res.WhichOneof('response') == 'eoe':
_LOGGER.info("end execute %s, spent: %d" % (res.eoe.sql, res.eoe.spent_time_seconds))
compound_message.add_html('\n'.join(resp_list), res)
break
resp_list.append(res.message.message)
from IPython.core.display import display, HTML
display(HTML('\n'.join(resp_list)))
else:
all_messages = []
all_messages.append(first.message.message)
eoe = None
for res in stream_response:
if res.WhichOneof('response') == 'eoe':
_LOGGER.info("end execute %s, spent: %d" % (res.eoe.sql, res.eoe.spent_time_seconds))
eoe = res
break
_LOGGER.debug(res.message.message)
all_messages.append(res.message.message)
compound_message.add_message('\n'.join(all_messages), eoe)

From the above implementation, all the logs would be show in the Notebook at the end of sql program execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant