Skip to content

[BEAM-3998] Futurize examples subpackage#5652

Merged
charlesccychen merged 1 commit into
apache:masterfrom
Fematich:examples
Jun 20, 2018
Merged

[BEAM-3998] Futurize examples subpackage#5652
charlesccychen merged 1 commit into
apache:masterfrom
Fematich:examples

Conversation

@Fematich

@Fematich Fematich commented Jun 14, 2018

Copy link
Copy Markdown
Contributor

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

aaltay commented Jun 14, 2018

Copy link
Copy Markdown
Member

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

@tvalentyn tvalentyn left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)})

@tvalentyn tvalentyn Jun 16, 2018

Copy link
Copy Markdown
Contributor

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.

@Fematich Fematich Jun 17, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

R: @charlesccychen

@tvalentyn

tvalentyn commented Jun 18, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@charlesccychen charlesccychen left a comment

Copy link
Copy Markdown
Contributor

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