Skip to content

Commit 0de270a

Browse files
authored
Merge pull request #41 from dataiku/bug/sc-163656-fix-add-an-error-column-mode
fix: [sc-163656] [API connect] Recipe fails in 'Add an error column' error mode
2 parents cde8a66 + 6bcb5ae commit 0de270a

5 files changed

Lines changed: 19 additions & 3 deletions

File tree

CHANGELOG.md

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

3+
## [Version 1.2.1](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.2.1) - Bugfix release - 2023-12-13
4+
5+
- Fix the `Add an error column` error behaviour on the recipe
6+
- Code-env descriptor for DSS 12
7+
8+
## [Version 1.1.5](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.1.5) - Bugfix release - 2023-12-13
9+
10+
- Fix the `Add an error column` error behaviour on the recipe
11+
- Code-env descriptor for DSS 11
12+
313
## [Version 1.2.0](https://github.com/dataiku/dss-plugin-api-connect/releases/tag/v1.2.0) - Feature and bugfix release - 2023-05-31
414

515
- Add Brotli compression

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "api-connect",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"meta": {
55
"label": "API Connect",
66
"description": "Retrieve data from any REST API",

python-lib/dku_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ class DKUConstants(object):
22
API_RESPONSE_KEY = "api_response"
33
FORBIDDEN_KEYS = ["token", "password", "api_key_value"]
44
FORM_DATA_BODY_FORMAT = "FORM_DATA"
5-
PLUGIN_VERSION = "1.2.0"
5+
PLUGIN_VERSION = "1.2.1"
66
RAW_BODY_FORMAT = "RAW"
77
REPONSE_ERROR_KEY = "dku_error"

python-lib/rest_api_recipe_session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ def retrieve_next_page(self, is_raw_output):
7878
logger.info("retrieve_next_page: Calling next page")
7979
json_response = self.client.paginated_api_call(can_raise_exeption=self.can_raise)
8080
default_dict = {
81-
DKUConstants.REPONSE_ERROR_KEY: json_response.get(DKUConstants.REPONSE_ERROR_KEY, None)
81+
DKUConstants.REPONSE_ERROR_KEY: ""
8282
} if self.behaviour_when_error == "keep-error-column" else {}
83+
if isinstance(json_response, dict) and DKUConstants.REPONSE_ERROR_KEY in default_dict:
84+
default_dict[DKUConstants.REPONSE_ERROR_KEY] = json_response.get(DKUConstants.REPONSE_ERROR_KEY, None)
8385
metadata = self.client.get_metadata() if self.display_metadata else default_dict
8486
is_api_returning_dict = True
8587
if self.extraction_key:

tests/python/integration/test_scenario.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ def test_run_api_connect_relative_url_pagination(user_dss_clients):
4545

4646
def test_run_api_connect_check_sc_110446(user_dss_clients):
4747
dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="CHECKSC110446")
48+
49+
50+
def test_run_api_connect_check_sc_163656_error_column_always_in_schema(user_dss_clients):
51+
dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="SC163656")

0 commit comments

Comments
 (0)