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 2021/07/10 20:23:41 UTC

[GitHub] [airflow] pateash edited a comment on issue #16911: Error in passing metadata to DataprocClusterCreateOperator

pateash edited a comment on issue #16911:
URL: https://github.com/apache/airflow/issues/16911#issuecomment-877698788


   found a workaround for though
   ```python
              path = f"gs://goog-dataproc-initialization-actions-{self.cfg.get('region')}/python/pip-install.sh"
   
               cluster_config =  ClusterGenerator(
                   project_id=self.cfg.get('project_id'),
                ...........
                   init_actions_uris=[
                       path
                   ],
                   metadata={'PIP_PACKAGES': 'pyyaml requests pandas openpyxl'},
                   properties=properties,
                   dag=dag
               ).make()
   
            return DataprocClusterCreateOperator(
               task_id='create_dataproc_cluster',
               cluster_name='my-cluster',
               project_id=self.cfg.get('project_id'),
               region=self.cfg.get('region'),
               cluster_config=cluster_config,
               dag=dag
           )
   ```
   
   @turbaszek @mik-laj @potiuk , I couldn't able to find an example where i will use new metadata field ( changed from DICT to  Sequence[Tuple[str, str]])
    for DataprocClusterCreateOperator() or DataprocCreateClusterOperator() for initialisations scripts installing PIP_PACKAGES.
   any time i tried to pass **[('PIP_PACKAGES', 'pyyaml requests pandas openpyxl')]** to metadata field, I get invalid metadata.
   How does this supposed to be passed, I couldn't able to find any guide in the docs as well?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org