DataProcOperator: TypeError: upload() got an unexpected keyword argument 'bucket_name'
See original GitHub issueSome modules version that could help:
apache-airflow==1.10.10 google-cloud-storage==1.26.0
Logs
[2020-07-12 08:03:03,455] {taskinstance.py:1145} ERROR - upload() got an unexpected keyword argument 'bucket_name'
Traceback (most recent call last):
File "/airflow/miniconda3/envs/airflow/lib/python3.6/site-packages/airflow/models/taskinstance.py", line 983, in _run_raw_task
result = task_copy.execute(context=context)
File "/airflow/miniconda3/envs/airflow/lib/python3.6/site-packages/airflow/contrib/operators/dataproc_operator.py", line 1145, in execute
self.main = self._upload_file_temp(bucket, self.main)
File "/airflow/miniconda3/envs/airflow/lib/python3.6/site-packages/airflow/contrib/operators/dataproc_operator.py", line 1108, in _upload_file_temp
filename=local_file
TypeError: upload() got an unexpected keyword argument 'bucket_name'
[2020-07-12 08:03:03,457] {taskinstance.py:1202} INFO - Marking task as FAILED.dag_id=snowplow_pipeline, task_id=text_to_partitioned_parquet, execution_date=20200711T000000, start_date=20200712T000301, end_date=20200712T000303
[2020-07-12 08:03:11,950] {logging_mixin.py:112} INFO - [2020-07-12 08:03:11,949] {local_task_job.py:103} INFO - Task exited with return code 1
Potential fix
Remove the name postfix from the bucket_name and object_name.
GoogleCloudStorageHook(
1103 google_cloud_storage_conn_id=self.gcp_conn_id
1104 ).upload(
1105 bucket=bucket,
1106 object=temp_filename,
1107 mime_type='application/x-python',
1108 filename=local_file
1109 )
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Reading file content from Cloud Storage - Stack Overflow
I have tested it myself and it is working. from google.cloud import storage client = storage.Client() BUCKET_NAME = '[BUCKET_NAME]' FILE_PATH = ...
Read more >How to fix Django TypeError got an unexpected keyword ...
Django TypeError when passing arguments via URLDjango view got an unexpected keyword argumentException Type: TypeErrorException Value: ...
Read more >Tree2Rec Got An Unexpected Keyword - ADocLib
TypeError : upload got an unexpected keyword argument 'offset' ignore duplicate and upload file but after it I got error and file wasn't...
Read more >Airflow Documentation - Read the Docs
We're about to create a DAG and some tasks, and we have the choice to explicitly pass a set of arguments to each....
Read more >TypeError: post() got an unexpected keyword argument 'user'
TypeError : post() got an unexpected keyword argument 'user'. why this error is shown ? TypeError: post() got an unexpected keyword argument ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You must start using the new import paths. This allows you to use new and old operators to be able to migrate gradually… Please look at: https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/operators/dlp.py Google will discuss in detail the migration to new operators at the Airflow Summit conference. https://airflowsummit.org/sessions/migration-to-airflow-backport-providers/
This issue has been closed because it has not received response from the issue author.