You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/05/14 10:10:16 UTC
[airflow-client-python] branch apply-2.0.1-fixes created (now
d061bb0)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a change to branch apply-2.0.1-fixes
in repository https://gitbox.apache.org/repos/asf/airflow-client-python.git.
at d061bb0 Fix version
This branch includes the following new commits:
new 941bf92 Prepare release 2.0.1 due to Openapi generator upgrade
new 4b8ff02 fixup! Prepare release 2.0.1 due to Openapi generator upgrade
new d061bb0 Fix version
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[airflow-client-python] 02/03: fixup! Prepare release 2.0.1 due to
Openapi generator upgrade
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch apply-2.0.1-fixes
in repository https://gitbox.apache.org/repos/asf/airflow-client-python.git
commit 4b8ff02522e99bef62a9f754919d42a715c0a471
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Fri May 14 08:14:28 2021 +0200
fixup! Prepare release 2.0.1 due to Openapi generator upgrade
---
dev/test_python_client.py | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dev/test_python_client.py b/dev/test_python_client.py
index 2f8785f..5c4a273 100644
--- a/dev/test_python_client.py
+++ b/dev/test_python_client.py
@@ -16,7 +16,7 @@
# under the License.
import airflow_client.client
from pprint import pprint
-from airflow_client.client.api import config_api
+from airflow_client.client.api import config_api, dag_api
# The client must use the authentication and authorization parameters
# in accordance with the API server security policy.
@@ -38,14 +38,26 @@ configuration = airflow_client.client.Configuration(
)
+with airflow_client.client.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ dag_api_instance = dag_api.DAGApi(api_client)
+
+ try:
+ # Get current configuration
+ api_response = dag_api_instance.get_dags()
+ pprint(api_response)
+ except airflow_client.client.ApiException as e:
+ print("Exception when calling DagAPI->get_dags: %s\n" % e)
+
+
# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = config_api.ConfigApi(api_client)
+ dag_api_instance = config_api.ConfigApi(api_client)
try:
# Get current configuration
- api_response = api_instance.get_config()
+ api_response = dag_api_instance.get_config()
pprint(api_response)
except airflow_client.client.ApiException as e:
print("Exception when calling ConfigApi->get_config: %s\n" % e)
[airflow-client-python] 01/03: Prepare release 2.0.1 due to Openapi
generator upgrade
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch apply-2.0.1-fixes
in repository https://gitbox.apache.org/repos/asf/airflow-client-python.git
commit 941bf92624b11059618e691668c72499c489ff8f
Author: Sumit Maheshwari <su...@astronomer.io>
AuthorDate: Thu May 13 12:41:16 2021 +0530
Prepare release 2.0.1 due to Openapi generator upgrade
---
airflow_client/.openapi-generator/FILES | 1 -
airflow_client/.openapi-generator/VERSION | 2 +-
airflow_client/README.md | 2 +-
airflow_client/client/__init__.py | 2 +-
airflow_client/client/api_client.py | 2 +-
airflow_client/client/configuration.py | 4 ++--
airflow_client/client/model_utils.py | 31 +++++++++++++++++++++----------
airflow_client/docs/DAGApi.md | 18 ------------------
airflow_client/docs/DAGRunApi.md | 4 ----
airflow_client/docs/PoolApi.md | 8 --------
airflow_client/docs/TaskInstanceApi.md | 8 ++++++--
11 files changed, 33 insertions(+), 49 deletions(-)
diff --git a/airflow_client/.openapi-generator/FILES b/airflow_client/.openapi-generator/FILES
index 7cb763d..39736ae 100644
--- a/airflow_client/.openapi-generator/FILES
+++ b/airflow_client/.openapi-generator/FILES
@@ -111,7 +111,6 @@ client/model/x_com_collection_all_of.py
client/model/x_com_collection_item.py
client/model_utils.py
client/models/__init__.py
-client/models/__init__.py
client/rest.py
docs/Action.md
docs/ActionCollection.md
diff --git a/airflow_client/.openapi-generator/VERSION b/airflow_client/.openapi-generator/VERSION
index acf69b4..3bff059 100644
--- a/airflow_client/.openapi-generator/VERSION
+++ b/airflow_client/.openapi-generator/VERSION
@@ -1 +1 @@
-5.1.0
\ No newline at end of file
+5.1.1
\ No newline at end of file
diff --git a/airflow_client/README.md b/airflow_client/README.md
index baa2c33..cd952e7 100644
--- a/airflow_client/README.md
+++ b/airflow_client/README.md
@@ -238,7 +238,7 @@ fulfilling the request.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.0.0
-- Package version: 1.0.0
+- Package version: 2.0.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://airflow.apache.org](https://airflow.apache.org)
diff --git a/airflow_client/client/__init__.py b/airflow_client/client/__init__.py
index bbedafa..8a592ee 100644
--- a/airflow_client/client/__init__.py
+++ b/airflow_client/client/__init__.py
@@ -28,7 +28,7 @@
"""
-__version__ = "1.0.0"
+__version__ = "2.0.1"
# import ApiClient
from airflow_client.client.api_client import ApiClient
diff --git a/airflow_client/client/api_client.py b/airflow_client/client/api_client.py
index 3b92f07..5ae4ed2 100644
--- a/airflow_client/client/api_client.py
+++ b/airflow_client/client/api_client.py
@@ -94,7 +94,7 @@ class ApiClient(object):
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
- self.user_agent = 'OpenAPI-Generator/1.0.0/python'
+ self.user_agent = 'OpenAPI-Generator/2.0.0/python'
def __enter__(self):
return self
diff --git a/airflow_client/client/configuration.py b/airflow_client/client/configuration.py
index ae881cf..618145d 100644
--- a/airflow_client/client/configuration.py
+++ b/airflow_client/client/configuration.py
@@ -91,7 +91,7 @@ class Configuration(object):
:param server_operation_variables: Mapping from operation ID to a mapping with
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum values before.
- :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format
:Example:
@@ -419,7 +419,7 @@ conf = client.Configuration(
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 1.0.0\n"\
- "SDK Package Version: 1.0.0".\
+ "SDK Package Version: 2.0.1".\
format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self):
diff --git a/airflow_client/client/model_utils.py b/airflow_client/client/model_utils.py
index b20f6b8..60c9902 100644
--- a/airflow_client/client/model_utils.py
+++ b/airflow_client/client/model_utils.py
@@ -1511,13 +1511,19 @@ def model_to_dict(model_instance, serialize=True):
# exist in attribute_map
attr = model_instance.attribute_map.get(attr, attr)
if isinstance(value, list):
- if not value or isinstance(value[0], PRIMITIVE_TYPES):
- # empty list or primitive types
- result[attr] = value
- elif isinstance(value[0], ModelSimple):
- result[attr] = [x.value for x in value]
- else:
- result[attr] = [model_to_dict(x, serialize=serialize) for x in value]
+ if not value:
+ # empty list or None
+ result[attr] = value
+ else:
+ res = []
+ for v in value:
+ if isinstance(v, PRIMITIVE_TYPES) or v is None:
+ res.append(v)
+ elif isinstance(v, ModelSimple):
+ res.append(v.value)
+ else:
+ res.append(model_to_dict(v, serialize=serialize))
+ result[attr] = res
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0],
@@ -1577,11 +1583,16 @@ def get_valid_classes_phrase(input_classes):
def convert_js_args_to_python_args(fn):
from functools import wraps
@wraps(fn)
- def wrapped_init(self, *args, **kwargs):
+ def wrapped_init(_self, *args, **kwargs):
+ """
+ An attribute named `self` received from the api will conflicts with the reserved `self`
+ parameter of a class method. During generation, `self` attributes are mapped
+ to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts.
+ """
spec_property_naming = kwargs.get('_spec_property_naming', False)
if spec_property_naming:
- kwargs = change_keys_js_to_python(kwargs, self.__class__)
- return fn(self, *args, **kwargs)
+ kwargs = change_keys_js_to_python(kwargs, _self.__class__)
+ return fn(_self, *args, **kwargs)
return wrapped_init
diff --git a/airflow_client/docs/DAGApi.md b/airflow_client/docs/DAGApi.md
index 1692f29..da1f46f 100644
--- a/airflow_client/docs/DAGApi.md
+++ b/airflow_client/docs/DAGApi.md
@@ -550,25 +550,7 @@ with client.ApiClient(configuration) as api_client:
api_instance = dag_api.DAGApi(api_client)
dag_id = "dag_id_example" # str | The DAG ID.
dag = DAG(
- dag_id="dag_id_example",
- root_dag_id="root_dag_id_example",
is_paused=True,
- is_subdag=True,
- fileloc="fileloc_example",
- file_token="file_token_example",
- owners=[
- "owners_example",
- ],
- description="description_example",
- schedule_interval=ScheduleInterval(
- type="CronExpression",
- value="value_example",
- ),
- tags=[
- Tag(
- name="name_example",
- ),
- ],
) # DAG |
update_mask = [
"update_mask_example",
diff --git a/airflow_client/docs/DAGRunApi.md b/airflow_client/docs/DAGRunApi.md
index e026cdf..708fcff 100644
--- a/airflow_client/docs/DAGRunApi.md
+++ b/airflow_client/docs/DAGRunApi.md
@@ -424,12 +424,8 @@ with client.ApiClient(configuration) as api_client:
dag_id = "dag_id_example" # str | The DAG ID.
dag_run = DAGRun(
dag_run_id="dag_run_id_example",
- dag_id="dag_id_example",
execution_date=dateutil_parser('1970-01-01T00:00:00.00Z'),
- start_date=dateutil_parser('1970-01-01T00:00:00.00Z'),
- end_date=dateutil_parser('1970-01-01T00:00:00.00Z'),
state=DagState("success"),
- external_trigger=True,
conf={},
) # DAGRun |
diff --git a/airflow_client/docs/PoolApi.md b/airflow_client/docs/PoolApi.md
index 22133b1..b8f705a 100644
--- a/airflow_client/docs/PoolApi.md
+++ b/airflow_client/docs/PoolApi.md
@@ -305,10 +305,6 @@ with client.ApiClient(configuration) as api_client:
pool = Pool(
name="name_example",
slots=1,
- occupied_slots=1,
- used_slots=1,
- queued_slots=1,
- open_slots=1,
) # Pool |
update_mask = [
"update_mask_example",
@@ -406,10 +402,6 @@ with client.ApiClient(configuration) as api_client:
pool = Pool(
name="name_example",
slots=1,
- occupied_slots=1,
- used_slots=1,
- queued_slots=1,
- open_slots=1,
) # Pool |
# example passing only required values which don't have defaults set
diff --git a/airflow_client/docs/TaskInstanceApi.md b/airflow_client/docs/TaskInstanceApi.md
index fe2482a..25100dc 100644
--- a/airflow_client/docs/TaskInstanceApi.md
+++ b/airflow_client/docs/TaskInstanceApi.md
@@ -472,8 +472,12 @@ with client.ApiClient(configuration) as api_client:
state=[
"state_example",
],
- pool=[],
- queue=[],
+ pool=[
+ "pool_example",
+ ],
+ queue=[
+ "queue_example",
+ ],
) # ListTaskInstanceForm |
# example passing only required values which don't have defaults set
[airflow-client-python] 03/03: Fix version
Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch apply-2.0.1-fixes
in repository https://gitbox.apache.org/repos/asf/airflow-client-python.git
commit d061bb049300d56abe4a0f8b98d77b6553a55339
Author: Sumit Maheshwari <su...@astronomer.io>
AuthorDate: Fri May 14 13:03:00 2021 +0530
Fix version
---
setup.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 9490efb..485c846 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,8 @@
from setuptools import setup, find_packages # noqa: H301
-VERSION = "2.1.0.dev"
+NAME = "apache-airflow-client"
+VERSION = "2.0.1"
# To install the library, run the following
#
# python setup.py install