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

Support CloudFunctionInvokeFunctionOperator #110

Closed
wants to merge 5 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2018 Etsy Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# see: https://airflow.apache.org/docs/apache-airflow-providers-google/stable/_api/airflow/providers/google/cloud/operators/functions/index.html
# and: https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/operators/functions.py

name: gcp_cloud_function_invoke
operator_class: CloudFunctionInvokeFunctionOperator
operator_class_module: airflow.providers.google.cloud.operators.functions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't see any other examples of using airflow.providers.google.cloud.... AFAIK it should be supported, just want to make sure that I'm not missing something...

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @peleyal , we use boundary-layer with airflow version 1.10.3. I'd like to check out this PR and make sure it has no adverse effects on our end since this operator doesn't yet exist there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Do you have any way to support later versions? Should we for example provide another plugin in this repo for all operators after 1.10.3?

Copy link
Contributor Author

@peleyal peleyal May 13, 2021

Choose a reason for hiding this comment

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

Thanks for adding #114 (comment). I'm just curious now, what happens if you add this operator but don't use it. Can it still break you guys?

Copy link
Contributor

Choose a reason for hiding this comment

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

It probably won't break us but it will likely confuse the community and our users as well if they try to use it. I'd prefer we not add it for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. Thanks for all you details and help!

schema_extends: base
parameters_jsonschema:
properties:
function_id:
type: string
input_data:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

input_data is Dict. I'm not sure if this is the right representation. PTAL.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct!

type: object
additionalProperties:
type: string
location:
type: string
project_id:
type: string
gcp_conn_id:
type: string
api_version:
type: string
impersonation_chain:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how to represent here string or array[string]. I just chose to represent it as array of strings. I guess I'll need to use anyof \ oneof, but I wasn't sure exactly how. PTAL and suggest a fix if I should change it... Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine as well

type: array
items:
type: string
required:
- function_id
- input_data
- location
additionalProperties: false