Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 2b3bd42

Browse files
authored
Alpha8 (#144)
* Update docstrings * Fix for bug #143 * Bump version * Update HISTORY.md
1 parent 2aa5c5d commit 2b3bd42

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# History
22

3+
## 2.0.0-alpha8 (2020-03-25)
4+
5+
- Updated docstrings
6+
- Bug fix for issue #143
7+
38
## 2.0.0-alpha7 (2020-03-23)
49

510
- Updated SDK name in HTTPClient default headers

pan_cortex_data_lake/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Main package for cortex."""
44

55
__author__ = "Palo Alto Networks"
6-
__version__ = "2.0.0-a7"
6+
__version__ = "2.0.0-a8"
77

88
from .exceptions import ( # noqa: F401
99
CortexError,

pan_cortex_data_lake/httpclient.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def __init__(self, **kwargs):
4747
Parameters:
4848
auto_refresh (bool): Perform token refresh following HTTP 401 response from server. Defaults to ``True``.
4949
auto_retry (bool): Retry last failed HTTP request following a token refresh. Defaults to ``True``.
50-
credentials (Credentials): :class:`~pancloud.credentials.Credentials` object. Defaults to ``None``.
51-
enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pancloud.exceptions.PanCloudError`. Defaults to ``False``.
50+
credentials (Credentials): :class:`~pan_cortex_data_lake.credentials.Credentials` object. Defaults to ``None``.
51+
enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pan_cortex_data_lake.exceptions.CortecError`. Defaults to ``False``.
5252
force_trace (bool): If ``True``, forces trace and forces ``x-request-id`` to be returned in the response headers. Defaults to ``False``.
5353
port (int): TCP port to append to URL. Defaults to ``443``.
54-
raise_for_status (bool): If ``True``, raises :exc:`~pancloud.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.
54+
raise_for_status (bool): If ``True``, raises :exc:`~pan_cortex_data_lake.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.
5555
url (str): URL to send API requests to - gets combined with ``port`` and :meth:`~request` ``path`` parameter. Defaults to ``None``.
5656
5757
Args:
@@ -164,9 +164,9 @@ def _send_request(self, enforce_json, method, raise_for_status, url, **kwargs):
164164
"""Send HTTP request.
165165
166166
Args:
167-
enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pancloud.exceptions.PanCloudError`. Defaults to ``False``.
167+
enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pan_cortex_data_lake.exceptions.CortecError`. Defaults to ``False``.
168168
method (str): HTTP method.
169-
raise_for_status (bool): If ``True``, raises :exc:`~pancloud.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.
169+
raise_for_status (bool): If ``True``, raises :exc:`~pan_cortex_data_lake.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.
170170
url (str): Request URL.
171171
**kwargs (dict): Re-packed key-word arguments.
172172
@@ -195,9 +195,9 @@ def request(self, **kwargs):
195195
flexibility and efficiency.
196196
197197
Parameters:
198-
enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pancloud.exceptions.HTTPError`. Defaults to ``False``.
198+
enforce_json (bool): Require properly-formatted JSON or raise :exc:`~pan_cortex_data_lake.exceptions.HTTPError`. Defaults to ``False``.
199199
path (str): URI path to append to URL. Defaults to ``empty``.
200-
raise_for_status (bool): If ``True``, raises :exc:`~pancloud.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.
200+
raise_for_status (bool): If ``True``, raises :exc:`~pan_cortex_data_lake.exceptions.HTTPError` if status_code not in 2XX. Defaults to ``False``.
201201
202202
Args:
203203
**kwargs: Supported :class:`~requests.Session` and :class:`~requests.adapters.HTTPAdapter` parameters.

pan_cortex_data_lake/query.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def cancel_job(self, job_id=None, **kwargs):
7676
7777
Args:
7878
job_id (str): Specifies the ID of the query job.
79-
**kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.
79+
**kwargs: Supported :meth:`~pan_cortex_data_lake.httpclient.HTTPClient.request` parameters.
8080
8181
Returns:
8282
requests.Response: Requests Response() object.
@@ -99,7 +99,7 @@ def create_query(self, job_id=None, query_params=None, **kwargs):
9999
Args:
100100
job_id (str): Specifies the ID of the query job. (optional)
101101
query_params (dict): Query parameters.
102-
**kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.
102+
**kwargs: Supported :meth:`~pan_cortex_data_lake.httpclient.HTTPClient.request` parameters.
103103
104104
Returns:
105105
requests.Response: Requests Response() object.
@@ -128,7 +128,7 @@ def get_job(self, job_id=None, **kwargs):
128128
Args:
129129
job_id (str): Specifies the ID of the query job.
130130
params (dict): Payload/request dictionary.
131-
**kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.
131+
**kwargs: Supported :meth:`~pan_cortex_data_lake.httpclient.HTTPClient.request` parameters.
132132
133133
Returns:
134134
requests.Response: Requests Response() object.
@@ -162,7 +162,7 @@ def get_job_results(
162162
page_number (int): Return the nth page from the result set as specified by this parameter.
163163
page_size (int): If specified, limits the size of a batch of results to the specified value. If un-specified, backend picks a size that may provide best performance.
164164
result_format (str): valuesArray or valuesJson.
165-
**kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.
165+
**kwargs: Supported :meth:`~pan_cortex_data_lake.httpclient.HTTPClient.request` parameters.
166166
167167
Returns:
168168
requests.Response: Requests Response() object.
@@ -212,7 +212,7 @@ def iter_job_results(
212212
page_number (int): Return the nth page from the result set as specified by this parameter.
213213
page_size (int): If specified, limits the size of a batch of results to the specified value. If un-specified, backend picks a size that may provide best performance.
214214
result_format (str): valuesArray or valuesJson.
215-
**kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.
215+
**kwargs: Supported :meth:`~pan_cortex_data_lake.httpclient.HTTPClient.request` parameters.
216216
217217
Yields:
218218
requests.Response: Requests Response() object.
@@ -249,7 +249,7 @@ def iter_job_results(
249249
else:
250250
yield r
251251
break
252-
elif r.json()["state"] == ("RUNNING" or "PENDING"):
252+
elif r.json()["state"] in ("RUNNING", "PENDING"):
253253
yield r
254254
time.sleep(1)
255255
elif r.json()["state"] == "FAILED":
@@ -275,7 +275,7 @@ def list_jobs(
275275
state (str): Job state, e.g. 'RUNNING', 'PENDING', 'FAILED', 'DONE'.
276276
job_type (str): Query type hint.
277277
tenant_id (str): Tenant ID.
278-
**kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.
278+
**kwargs: Supported :meth:`~pan_cortex_data_lake.httpclient.HTTPClient.request` parameters.
279279
280280
Returns:
281281
requests.Response: Requests Response() object.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 2.0.0a7
2+
current_version = 2.0.0a8
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
setup(
2424
name="pan-cortex-data-lake",
25-
version="2.0.0-a7",
25+
version="2.0.0-a8",
2626
description="Python idiomatic SDK for Cortex™ Data Lake.",
2727
long_description=readme + "\n\n" + history,
2828
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)