Skip to content

Commit 1586358

Browse files
gabrielgeorgiev1duyguHsnHsn
authored andcommitted
vdk-impala, vdk-trino: Remove deprecated use of result field (#933)
The _Result object from pluggy features a result field, which was deprecated in earlier versions in favour of get_result(), and removed entirely in 1.0. This change removes references to it which caused an error for a heartbeat test. Testing done: CICD Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
1 parent ba6687e commit 1586358

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

projects/vdk-plugins/vdk-impala/src/vdk/plugin/impala/impala_plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ def run_step(context: JobContext, step: Step) -> None:
110110
out: HookCallResult
111111
out = yield
112112

113-
if out.result.exception:
114-
if is_impala_user_error(out.result.exception):
113+
if out.get_result().exception:
114+
if is_impala_user_error(out.get_result().exception):
115115
raise UserCodeError(
116116
ErrorMessage(
117117
summary="Error occurred.",
118-
what=f"Error occurred. Exception message: {out.result.exception}",
118+
what=f"Error occurred. Exception message: {out.get_result().exception}",
119119
why="Review exception for details.",
120120
consequences="Data Job execution will not continue.",
121121
countermeasures="Review exception for details.",
122122
)
123-
) from out.result.exception
123+
) from out.get_result().exception
124124

125125
@staticmethod
126126
@hookimpl

projects/vdk-plugins/vdk-trino/src/vdk/plugin/trino/trino_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def run_step(context: JobContext, step: Step) -> None:
9999
exc_type, exc_value, exc_traceback = out.excinfo
100100
if isinstance(exc_value, TrinoUserError):
101101
raise UserCodeError(ErrorMessage()) from exc_value
102-
if out.result:
103-
step_result: StepResult = out.result
102+
if out.get_result():
103+
step_result: StepResult = out.get_result()
104104
if isinstance(step_result.exception, requests.exceptions.ConnectionError):
105105
raise VdkConfigurationError(
106106
ErrorMessage(

0 commit comments

Comments
 (0)