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

Introduce Python3 compatibility in example #2032

Merged
merged 2 commits into from
Feb 14, 2017

Conversation

amarco90
Copy link
Contributor

The example in examples/foo_complex.py does not work in Python3 due to the division operator.

Description

I fixed the error by importing the division operator from __future__ and using the integer division operator (//).

Motivation and Context

When running the example using Python3 I was getting the following error:

  File "/Users/amarco/Desktop/luigi/examples/foo_complex.py", line 64, in requires
    for i in range(valor / max_depth):
TypeError: 'float' object cannot be interpreted as an integer

Have you tested this? If so, how?

I ran the example task and it completed successfully:

===== Luigi Execution Summary =====
Scheduled 51 tasks of which:
* 51 ran successfully:
    - 50 examples.Bar(num=0,1,10,11,12,13,14,15,16,17,18,...)
    - 1 examples.Foo()

This progress looks :) because there were no failed tasks or missing external dependencies
===== Luigi Execution Summary =====

@mention-bot
Copy link

@amarco90, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hadesbox and @Tarrasch to be potential reviewers.

@Tarrasch Tarrasch merged commit 7701d9f into spotify:master Feb 14, 2017
@Tarrasch
Copy link
Contributor

Thanks! :)

This was referenced Jun 29, 2022
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 this pull request may close these issues.

3 participants