Skip to content

Conversation

@Fematich
Copy link
Contributor

@Fematich Fematich commented Jun 14, 2018

This pull request prepares the examples subpackage for Python 3 support. This PR is part of a series in which all subpackages will be updated using the same approach.
This approach has been documented here and the first pull request in the series (Futurize coders subpackage) demonstrating this approach can be found at #5053.

R: @aaltay @tvalentyn @RobbeSneyders

@Fematich Fematich changed the title [BEAM-3898] Futurize examples subpackage [BEAM-3998] Futurize examples subpackage Jun 14, 2018
@aaltay
Copy link
Member

aaltay commented Jun 14, 2018

Thank you. I will wait for @tvalentyn to make the first pass.

Copy link
Contributor

@tvalentyn tvalentyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Fematich . Overall LGTM, a few minor comments below.

'team': row[1],
'score': int(row[2]),
'timestamp': int(row[3]) / 1000.0,
'timestamp': int(row[3]) // 1000.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reguilar division given the float number.

'team': row[1],
'score': int(row[2]),
'timestamp': int(row[3]) / 1000.0,
'timestamp': (int(row[3])//1000.0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Also not sure why the tool added parenthesis on both sides.

'team': row[1],
'score': int(row[2]),
'timestamp': int(row[3]) / 1000.0,
'timestamp': (int(row[3])//1000.0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

'team': row[1],
'score': int(row[2]),
'timestamp': int(row[3]) / 1000.0,
'timestamp': (int(row[3])//1000.0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

googledatastore.helper.add_key_path(entity.key, kind, str(uuid.uuid4()))
googledatastore.helper.add_properties(entity,
{'content': six.text_type(content)})
{'content': unicode(content)})
Copy link
Contributor

@tvalentyn tvalentyn Jun 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several other modules in the examples package also use six, let's clean them up.
See: https://github.com/apache/beam/search?q=six.text_type&unscoped_q=six.text_type.

Copy link
Contributor Author

@Fematich Fematich Jun 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all the remaining six imports with the latest commit.

@tvalentyn
Copy link
Contributor

R: @charlesccychen

@tvalentyn
Copy link
Contributor

tvalentyn commented Jun 18, 2018

Thanks, @Fematich. Did you push the updated commit? I still see six removed only in one location, and still see // used in a few places I called out where I think / should be used.

@Fematich
Copy link
Contributor Author

Sorry for that! Apparently I didn't push my latest commit, fixed now

Copy link
Contributor

@charlesccychen charlesccychen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Fematich. This LGTM.

@charlesccychen charlesccychen merged commit 43a4044 into apache:master Jun 20, 2018
charlesccychen added a commit to charlesccychen/beam that referenced this pull request Jul 24, 2018
[BEAM-3998] Futurize examples subpackage
charlesccychen added a commit to charlesccychen/beam that referenced this pull request Jul 26, 2018
[BEAM-3998] Futurize examples subpackage
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.

4 participants