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

Metaflow is changing indentation #223

Closed
sergiocalde94 opened this issue Jun 18, 2020 · 2 comments · Fixed by #244
Closed

Metaflow is changing indentation #223

sergiocalde94 opened this issue Jun 18, 2020 · 2 comments · Fixed by #244

Comments

@sergiocalde94
Copy link

Hi again, sorry for the spam (👎 to me)

I have also found this, it turns out that metaflow eliminates all the indentation from the logs, I find the truth a bit strange but I'm sure you can tell me the reason for this.

In addition, related to #221 it also happens that the prints are logged at the end of the code and the tqdm (in this case) even if it appears later than the prints in the code comes out first in the final log of Metaflow.

dummy_flow.py code for reproducibility:

from metaflow import FlowSpec, step
from time import sleep
from tqdm import tqdm


class DummyFlow(FlowSpec):
    """Dummy flow
    """
    @step
    def start(self):
        """Start of our dummy flow
        """
        print('Welcome to your dummy flow! \N{grinning face}')

        self.next(self.test_logs)

    @step
    def test_logs(self):
        """Test indentation and progress bar
        """
        print("             Hi! I am an indented text...")
        print("Hello, I´m not!")
        
        for i in tqdm(range(10000)):
            sleep(.00001)
            continue

        self.next(self.end)

    @step
    def end(self):
        """
        Last step in the flow, says goodbye
        """
        print('Goodbye!.')


if __name__ == '__main__':
    DummyFlow()

And the output:

metaflow

Some advices about this? Thanks!

@savingoyal
Copy link
Collaborator

Thanks for the issue! Let me look into this.

savingoyal added a commit that referenced this issue Jul 1, 2020
@savingoyal savingoyal linked a pull request Jul 1, 2020 that will close this issue
savingoyal added a commit that referenced this issue Jul 1, 2020
@sergiocalde94
Copy link
Author

Thanks for closing this :) @savingoyal

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

Successfully merging a pull request may close this issue.

2 participants