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

Update KubernetesPodOperator kubernetes_min_pod example #2065

Merged
merged 10 commits into from
Apr 8, 2019
Merged

Update KubernetesPodOperator kubernetes_min_pod example #2065

merged 10 commits into from
Apr 8, 2019

Conversation

leahecole
Copy link
Collaborator

In this oprator, the kubernetes_min_pod fails without the 'cmds' parameter set

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 22, 2019
@leahecole
Copy link
Collaborator Author

@tswast , the Travis CI build is failing on the pythonvirtualenvoperator_python2_test.py - are these shells of tests that are in here? Any ideas of how to proceed?

@tswast
Copy link
Contributor

tswast commented Mar 22, 2019

@leahecole Yes, the Travis output is from the tests here.

nox > flake8 --show-source --builtin gettext --max-complexity 20 --import-order-style google --exclude .nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py --ignore=E121,E123,E126,E226,E24,E704,W503,W504,I100,I201,I202 --application-import-names use_local_deps,pythonvirtualenvoperator_python2,unit_testing_variables,unit_testing,simple,unit_testing_test,bq_notify,connections,__init__,trigger_response_dag_test,quickstart_test,kubernetes_pod_operator_test,connections_test,bq_notify_test,bq_copy_across_locations,bashoperator_python2_test,kubernetes_pod_operator,simple_test,dependencies,use_local_deps_test,trigger_response_dag,bq_copy_across_locations_test,unit_testing_cycle,bashoperator_python2,quickstart,pythonvirtualenvoperator_python2_test .
./pythonvirtualenvoperator_python2_test.py:15:1: F401 'sys' imported but unused
import sys
^
./pythonvirtualenvoperator_python2_test.py:17:1: F401 'pytest' imported but unused
import pytest
^
nox > Command flake8 --show-source --builtin gettext --max-complexity 20 --import-order-style google --exclude .nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py --ignore=E121,E123,E126,E226,E24,E704,W503,W504,I100,I201,I202 --application-import-names use_local_deps,pythonvirtualenvoperator_python2,unit_testing_variables,unit_testing,simple,unit_testing_test,bq_notify,connections,__init__,trigger_response_dag_test,quickstart_test,kubernetes_pod_operator_test,connections_test,bq_notify_test,bq_copy_across_locations,bashoperator_python2_test,kubernetes_pod_operator,simple_test,dependencies,use_local_deps_test,trigger_response_dag,bq_copy_across_locations_test,unit_testing_cycle,bashoperator_python2,quickstart,pythonvirtualenvoperator_python2_test . failed with exit code 1
nox > Session lint(sample='./composer/workflows') failed.

The flake8 command found imports that aren't used. Remove them to pass the linter.

I recommend getting a Python development environment setup with multiple Python versions (see: https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/MAC_SETUP.md) for how I have my system setup. Then see the instructions at https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#using-nox for running nox to run the tests locally.

In your case, run (in a Python 3 virtual environment) from the python-docs-samples/ directory these command:

pip install --upgrade nox
nox -s "lint(sample='./composer/workflows')"

That should replicate what Travis is doing.

Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

LGTM, since test failures are unrelated to this change. Probably need a follow-up PR to clean those up, though.

@leahecole
Copy link
Collaborator Author

@tswast sorry for the delay - I lost sight of this. Cool to merge? All I changed was commenting out the things that made the linter barf :)

@@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
# import sys
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete these lines rather than comment them out.

Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

LGTM. Okay to merge!

@leahecole leahecole merged commit 147e4ba into GoogleCloudPlatform:master Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants