Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Add Test Cases for Python 3.7 #720

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

seii-saintway
Copy link

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@seii-saintway
Copy link
Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@coveralls
Copy link

coveralls commented Oct 4, 2019

Coverage Status

Coverage decreased (-0.01%) to 77.86% when pulling 7934bcf on seii-saintway:fix/py37-async-and-yaml into 8c2df84 on googledatalab:master.

paveldournov
paveldournov previously approved these changes Mar 5, 2020
Copy link

@paveldournov paveldournov left a comment

Choose a reason for hiding this comment

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

LGTM

@crwilcox
Copy link
Contributor

crwilcox commented Mar 5, 2020

This seems good, except for some linting errors:

./datalab/utils/_async.py:66:101: E501 line too long (103 > 100 characters)
./google/datalab/utils/_async.py:66:101: E501 line too long (103 > 100 characters)

yixinshi
yixinshi previously approved these changes Mar 6, 2020
@crwilcox
Copy link
Contributor

crwilcox commented Mar 10, 2020

Thanks @seii-saintway for this. Due to the linting issues and an atypical var name, I ended up making a new PR, #728 that does a very similar thing. I also didn't include yaml loader changes. I am not sure how those relate to python3.7+ support.

@seii-saintway
Copy link
Author

seii-saintway commented Mar 10, 2020

Thanks @crwilcox for the new PR. I have some memory of troubles of the yaml loader thing. And I think we should consider thoroughly. Because I felt that there are some other troubles in Python 3.7 environment.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@seii-saintway
Copy link
Author

I just want to see if I can merge this PR or not after I solve the linting errors
(^_^)

@seii-saintway
Copy link
Author

@googlebot I signed it!

@seii-saintway
Copy link
Author

@googlebot I fixed it.

1 similar comment
@seii-saintway
Copy link
Author

@googlebot I fixed it.

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@monotaro-sheng-wei
Copy link

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@@ -328,6 +329,8 @@ def parse_config(config, env, as_dict=True):
config = {}
elif stripped[0] == '{':
config = json.loads(config)
elif six.PY3:
config = yaml.load(config, Loader=yaml.FullLoader)
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these loader changes addressing? This seems unrelated to Python 3.7 compat to me at first glance.

Copy link
Author

@seii-saintway seii-saintway Mar 12, 2020

Choose a reason for hiding this comment

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

I am sorry that I cannot remember the reason clearly.
But I searched on google and found an issue concerning pyyaml version.

I remember that I built the datalab image with py37 and got into some troubles with pyyaml before.

As the pyyaml version show as below,

'pyyaml>=3.11',

I guess that pyyaml will be installed as different version in py2 and py3.

As you could see in the py35 coverage test, there were warnings concerning YAMLLoadWarning.

/home/travis/build/googledatalab/pydatalab/tests/pipeline/pipeline_tests.py:305: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  dag_dict = yaml.load(PipelineTest._test_pipeline_yaml_spec)
/home/travis/build/googledatalab/pydatalab/tests/pipeline/pipeline_tests.py:265: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  dag_dict = yaml.load(PipelineTest._test_pipeline_yaml_spec)
/home/travis/build/googledatalab/pydatalab/tests/pipeline/pipeline_tests.py:280: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  dag_dict = yaml.load(PipelineTest._test_pipeline_yaml_spec)

Maybe there will be warnings or errors in py37, too.
I'm sorry that maybe it is better to open a new PR concerning the YAMLLoadWarning thing.
And it is better add some py37 coverage tests.

@@ -12,7 +12,7 @@

"""Google Cloud Platform library - Internal Helpers."""

from ._async import async, async_function, async_method
from ._async import async_, async_function, async_method
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for incorporating the naming style from #728. It is shorter and a more standard pattern.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks you very much for your support.

@seii-saintway seii-saintway changed the title #711 Fix Incompatibility with Python 3.7 Add Test Cases for Python 3.7 Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants