You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/10 12:13:36 UTC
[GitHub] [airflow] roelhogervorst opened a new pull request #8240: GCP
SparkR Example
roelhogervorst opened a new pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240
Show how to schedule R, and sparkR jobs on a dataproc cluster.
The functionality to run that kind of job is already in dataproc,
but it was not so clear how to do that from Airflow.
This is a replacement for https://github.com/apache/airflow/pull/7864
---
Make sure to mark the boxes below before creating PR: [x]
- [x] Description above provides context of the change
- [x] Unit tests coverage for changes (not needed for documentation changes)
- [ ] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
- [ ] Relevant documentation is updated including usage instructions.
- [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
---
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io commented on issue #8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#issuecomment-612055560
# [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=h1) Report
> Merging [#8240](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/e945439abead0daf4cf6f8065069e6549c7e5205&el=desc) will **decrease** coverage by `55.10%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8240 +/- ##
===========================================
- Coverage 88.33% 33.23% -55.11%
===========================================
Files 936 936
Lines 45319 45324 +5
===========================================
- Hits 40034 15064 -24970
- Misses 5285 30260 +24975
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ders/google/cloud/example\_dags/example\_dataproc.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvZ29vZ2xlL2Nsb3VkL2V4YW1wbGVfZGFncy9leGFtcGxlX2RhdGFwcm9jLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/S3\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9TM19ob29rLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/pig\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9waWdfaG9vay5weQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/hdfs\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9oZGZzX2hvb2sucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/http\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9odHRwX2hvb2sucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/jdbc\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9qZGJjX2hvb2sucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/druid\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9kcnVpZF9ob29rLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/hive\_hooks.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9oaXZlX2hvb2tzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/mssql\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9tc3NxbF9ob29rLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/hooks/mysql\_hook.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9teXNxbF9ob29rLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [808 more](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=footer). Last update [e945439...f6fddd7](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r406738057
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -38,7 +38,8 @@
OUTPUT_PATH = "gs://{}/{}/".format(BUCKET, OUTPUT_FOLDER)
PYSPARK_MAIN = os.environ.get("PYSPARK_MAIN", "hello_world.py")
PYSPARK_URI = "gs://{}/{}".format(BUCKET, PYSPARK_MAIN)
-
+SPARKR_MAIN = os.environ.get("SPARKR_MAIN", "hello_world.R")
Review comment:
I'm ok with `SPARKR_MAIN`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] roelhogervorst commented on a change in pull request
#8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
roelhogervorst commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r407958579
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -38,7 +38,8 @@
OUTPUT_PATH = "gs://{}/{}/".format(BUCKET, OUTPUT_FOLDER)
PYSPARK_MAIN = os.environ.get("PYSPARK_MAIN", "hello_world.py")
PYSPARK_URI = "gs://{}/{}".format(BUCKET, PYSPARK_MAIN)
-
+SPARKR_MAIN = os.environ.get("SPARKR_MAIN", "hello_world.R")
Review comment:
I will have to check what environmental var is set in dataproc. because this var refers to the main location of the executable right?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r406746389
##########
File path: tests/providers/google/cloud/operators/test_dataproc_system.py
##########
@@ -35,16 +37,28 @@
print(words)
"""
+sparkr_file = """
+#!/usr/bin/r
+sparkR.session()
+# Create the SparkDataFrame
+df <- as.DataFrame(faithful)
+head(summarize(groupBy(df, df$waiting), count = n(df$waiting)))
+"""
Review comment:
When running this test I got the following error:
```
Error: could not find function "sparkR.session"
Execution halted
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] roelhogervorst commented on a change in pull request
#8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
roelhogervorst commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r407961722
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -104,6 +105,12 @@
"pyspark_job": {"main_python_file_uri": PYSPARK_URI},
}
+SPARKR_JOB = {
+ "reference": {"project_id": PROJECT_ID},
+ "placement": {"cluster_name": CLUSTER_NAME},
+ "sparkRJob": {"mainRFileUri": SPARKR_URI},
Review comment:
I don't think that works for dataproc. I will have to check but I thought the REST api only accepts sparkRJob: https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs#Job
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io edited a comment on issue #8240: GCP SparkR
Example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#issuecomment-612055560
# [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=h1) Report
> Merging [#8240](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/e945439abead0daf4cf6f8065069e6549c7e5205&el=desc) will **decrease** coverage by `0.65%`.
> The diff coverage is `100.00%`.
[](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8240 +/- ##
==========================================
- Coverage 88.33% 87.68% -0.66%
==========================================
Files 936 940 +4
Lines 45319 45359 +40
==========================================
- Hits 40034 39774 -260
- Misses 5285 5585 +300
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ders/google/cloud/example\_dags/example\_dataproc.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvZ29vZ2xlL2Nsb3VkL2V4YW1wbGVfZGFncy9leGFtcGxlX2RhdGFwcm9jLnB5) | `100.00% <100.00%> (ø)` | |
| [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
| [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
| [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
| [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
| [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
| [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
| ... and [52 more](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=footer). Last update [e945439...933cd6e](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r406745858
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -104,6 +105,12 @@
"pyspark_job": {"main_python_file_uri": PYSPARK_URI},
}
+SPARKR_JOB = {
+ "reference": {"project_id": PROJECT_ID},
+ "placement": {"cluster_name": CLUSTER_NAME},
+ "sparkRJob": {"mainRFileUri": SPARKR_URI},
Review comment:
```suggestion
"spark_r_job": {"main_r_file_uri": SPARKR_URI},
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io edited a comment on issue #8240: GCP SparkR
Example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#issuecomment-612055560
# [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=h1) Report
> Merging [#8240](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/e945439abead0daf4cf6f8065069e6549c7e5205&el=desc) will **decrease** coverage by `0.65%`.
> The diff coverage is `100.00%`.
[](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8240 +/- ##
==========================================
- Coverage 88.33% 87.68% -0.66%
==========================================
Files 936 940 +4
Lines 45319 45359 +40
==========================================
- Hits 40034 39774 -260
- Misses 5285 5585 +300
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ders/google/cloud/example\_dags/example\_dataproc.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvZ29vZ2xlL2Nsb3VkL2V4YW1wbGVfZGFncy9leGFtcGxlX2RhdGFwcm9jLnB5) | `100.00% <100.00%> (ø)` | |
| [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
| [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
| [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
| [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
| [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
| [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
| ... and [52 more](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=footer). Last update [e945439...933cd6e](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek merged pull request #8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek merged pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] boring-cyborg[bot] commented on issue #8240: GCP SparkR
Example
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#issuecomment-614426954
Awesome work, congrats on your first merged pull request!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io edited a comment on issue #8240: GCP SparkR
Example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#issuecomment-612055560
# [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=h1) Report
> Merging [#8240](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/e945439abead0daf4cf6f8065069e6549c7e5205&el=desc) will **decrease** coverage by `27.58%`.
> The diff coverage is `100.00%`.
[](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8240 +/- ##
===========================================
- Coverage 88.33% 60.75% -27.59%
===========================================
Files 936 940 +4
Lines 45319 45359 +40
===========================================
- Hits 40034 27556 -12478
- Misses 5285 17803 +12518
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ders/google/cloud/example\_dags/example\_dataproc.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvZ29vZ2xlL2Nsb3VkL2V4YW1wbGVfZGFncy9leGFtcGxlX2RhdGFwcm9jLnB5) | `100.00% <100.00%> (ø)` | |
| [airflow/providers/exasol/operators/exasol.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvZXhhc29sL29wZXJhdG9ycy9leGFzb2wucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/providers/amazon/aws/hooks/kinesis.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9ob29rcy9raW5lc2lzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/providers/apache/livy/sensors/livy.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2xpdnkvc2Vuc29ycy9saXZ5LnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/providers/amazon/aws/sensors/redshift.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9zZW5zb3JzL3JlZHNoaWZ0LnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/providers/mysql/operators/s3\_to\_mysql.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL3MzX3RvX215c3FsLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [airflow/providers/microsoft/azure/operators/adx.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbWljcm9zb2Z0L2F6dXJlL29wZXJhdG9ycy9hZHgucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...irflow/providers/amazon/aws/hooks/batch\_waiters.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9ob29rcy9iYXRjaF93YWl0ZXJzLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...ow/providers/amazon/aws/secrets/secrets\_manager.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9zZWNyZXRzL3NlY3JldHNfbWFuYWdlci5weQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [338 more](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=footer). Last update [e945439...2549e1e](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r408000545
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -104,6 +105,12 @@
"pyspark_job": {"main_python_file_uri": PYSPARK_URI},
}
+SPARKR_JOB = {
+ "reference": {"project_id": PROJECT_ID},
+ "placement": {"cluster_name": CLUSTER_NAME},
+ "sparkRJob": {"mainRFileUri": SPARKR_URI},
Review comment:
I run this example and got errors so I made fixes and it works :) Python libraries prefer snake_case, take a look at other jobs definition in this file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r408003503
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -38,7 +38,8 @@
OUTPUT_PATH = "gs://{}/{}/".format(BUCKET, OUTPUT_FOLDER)
PYSPARK_MAIN = os.environ.get("PYSPARK_MAIN", "hello_world.py")
PYSPARK_URI = "gs://{}/{}".format(BUCKET, PYSPARK_MAIN)
-
+SPARKR_MAIN = os.environ.get("SPARKR_MAIN", "hello_world.R")
Review comment:
The environment variable is taken from the environment where you run Airflow, not from Dataproc.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] roelhogervorst commented on a change in pull request
#8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
roelhogervorst commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r408773894
##########
File path: tests/providers/google/cloud/operators/test_dataproc_system.py
##########
@@ -35,16 +37,28 @@
print(words)
"""
+sparkr_file = """
+#!/usr/bin/r
+sparkR.session()
+# Create the SparkDataFrame
+df <- as.DataFrame(faithful)
+head(summarize(groupBy(df, df$waiting), count = n(df$waiting)))
+"""
Review comment:
Check. Found the apache spark documentation. and modified example
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r408000545
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -104,6 +105,12 @@
"pyspark_job": {"main_python_file_uri": PYSPARK_URI},
}
+SPARKR_JOB = {
+ "reference": {"project_id": PROJECT_ID},
+ "placement": {"cluster_name": CLUSTER_NAME},
+ "sparkRJob": {"mainRFileUri": SPARKR_URI},
Review comment:
I run this example and got errors so I made fixes and it works :) Python libraries prefer snake_case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] turbaszek commented on a change in pull request #8240:
GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r406746389
##########
File path: tests/providers/google/cloud/operators/test_dataproc_system.py
##########
@@ -35,16 +37,28 @@
print(words)
"""
+sparkr_file = """
+#!/usr/bin/r
+sparkR.session()
+# Create the SparkDataFrame
+df <- as.DataFrame(faithful)
+head(summarize(groupBy(df, df$waiting), count = n(df$waiting)))
+"""
Review comment:
When running this test I got the following error on Dataproc:
```
Error: could not find function "sparkR.session"
Execution halted
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] roelhogervorst commented on a change in pull request
#8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
roelhogervorst commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r406733588
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -38,7 +38,8 @@
OUTPUT_PATH = "gs://{}/{}/".format(BUCKET, OUTPUT_FOLDER)
PYSPARK_MAIN = os.environ.get("PYSPARK_MAIN", "hello_world.py")
PYSPARK_URI = "gs://{}/{}".format(BUCKET, PYSPARK_MAIN)
-
+SPARKR_MAIN = os.environ.get("SPARKR_MAIN", "hello_world.R")
Review comment:
or SPARKR_DRIVER_R?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] codecov-io edited a comment on issue #8240: GCP SparkR
Example
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#issuecomment-612055560
# [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=h1) Report
> Merging [#8240](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/e945439abead0daf4cf6f8065069e6549c7e5205&el=desc) will **decrease** coverage by `0.65%`.
> The diff coverage is `100.00%`.
[](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #8240 +/- ##
==========================================
- Coverage 88.33% 87.68% -0.66%
==========================================
Files 936 940 +4
Lines 45319 45359 +40
==========================================
- Hits 40034 39774 -260
- Misses 5285 5585 +300
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...ders/google/cloud/example\_dags/example\_dataproc.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvZ29vZ2xlL2Nsb3VkL2V4YW1wbGVfZGFncy9leGFtcGxlX2RhdGFwcm9jLnB5) | `100.00% <100.00%> (ø)` | |
| [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.25% <0.00%> (-72.50%)` | :arrow_down: |
| [...w/providers/apache/hive/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2hpdmUvb3BlcmF0b3JzL215c3FsX3RvX2hpdmUucHk=) | `35.84% <0.00%> (-64.16%)` | :arrow_down: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0.00%> (-55.56%)` | :arrow_down: |
| [airflow/providers/postgres/operators/postgres.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcG9zdGdyZXMvb3BlcmF0b3JzL3Bvc3RncmVzLnB5) | `47.82% <0.00%> (-52.18%)` | :arrow_down: |
| [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0.00%> (-47.06%)` | :arrow_down: |
| [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0.00%> (-46.67%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `47.18% <0.00%> (-45.08%)` | :arrow_down: |
| [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55.00% <0.00%> (-45.00%)` | :arrow_down: |
| ... and [52 more](https://codecov.io/gh/apache/airflow/pull/8240/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=footer). Last update [e945439...933cd6e](https://codecov.io/gh/apache/airflow/pull/8240?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [airflow] roelhogervorst commented on a change in pull request
#8240: GCP SparkR Example
Posted by GitBox <gi...@apache.org>.
roelhogervorst commented on a change in pull request #8240: GCP SparkR Example
URL: https://github.com/apache/airflow/pull/8240#discussion_r406733054
##########
File path: airflow/providers/google/cloud/example_dags/example_dataproc.py
##########
@@ -38,7 +38,8 @@
OUTPUT_PATH = "gs://{}/{}/".format(BUCKET, OUTPUT_FOLDER)
PYSPARK_MAIN = os.environ.get("PYSPARK_MAIN", "hello_world.py")
PYSPARK_URI = "gs://{}/{}".format(BUCKET, PYSPARK_MAIN)
-
+SPARKR_MAIN = os.environ.get("SPARKR_MAIN", "hello_world.R")
Review comment:
I'm not actually sure what environ var I should use here? SPARKR_RLIBDIR ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services