Skip to content

Commit 72c24ce

Browse files
committed
nit: update variable names
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
1 parent 7dbf4e7 commit 72c24ce

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

pynumaflow/_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
# Error Constants
1111
RUNTIME_APPLICATION_ERRORS_PATH = "/var/numaflow/runtime/application-errors"
12-
CURRENT_FILE = "current-udf.json"
13-
INTERNAL_ERROR = "Internal error"
12+
CURRENT_CRITICAL_ERROR_FILE = "current-udf.json"
13+
INTERNAL_ERROR_CODE = "Internal error"
1414
CONTAINER_TYPE = os.getenv(ENV_UD_CONTAINER_TYPE, "unknown-container")
1515
ERR_UDF_EXCEPTION_STRING = f"UDF_EXECUTION_ERROR({CONTAINER_TYPE})"
1616

pynumaflow/errors/errors.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from pynumaflow._constants import (
66
CONTAINER_TYPE,
77
RUNTIME_APPLICATION_ERRORS_PATH,
8-
CURRENT_FILE,
9-
INTERNAL_ERROR,
8+
CURRENT_CRITICAL_ERROR_FILE,
9+
INTERNAL_ERROR_CODE,
1010
)
1111
from pynumaflow.errors._dtypes import _RuntimeErrorEntry
1212
from typing import Union
@@ -62,8 +62,8 @@ def _persist_critical_error_to_file(
6262
container_dir = os.path.join(dir_path, CONTAINER_TYPE)
6363
os.makedirs(container_dir, mode=0o777, exist_ok=True)
6464

65-
current_file_path = os.path.join(container_dir, CURRENT_FILE)
66-
error_code = error_code or INTERNAL_ERROR
65+
current_file_path = os.path.join(container_dir, CURRENT_CRITICAL_ERROR_FILE)
66+
error_code = error_code or INTERNAL_ERROR_CODE
6767
current_timestamp = int(time.time())
6868

6969
runtime_error_entry = _RuntimeErrorEntry(

tests/errors/test_persist_critical_error.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import unittest
66
from pynumaflow.errors.errors import persist_critical_error, _persist_error_once
77
from pynumaflow.errors.errors import _persist_critical_error_to_file
8-
from pynumaflow._constants import CONTAINER_TYPE, INTERNAL_ERROR
8+
from pynumaflow._constants import CONTAINER_TYPE, INTERNAL_ERROR_CODE
99

1010

1111
class TestErrorPersistence(unittest.TestCase):
@@ -75,7 +75,7 @@ def test_uses_default_error_code_if_none_provided(self):
7575

7676
with open(os.path.join(container_dir, files[0])) as f:
7777
error_data = json.load(f)
78-
self.assertEqual(error_data["code"], INTERNAL_ERROR)
78+
self.assertEqual(error_data["code"], INTERNAL_ERROR_CODE)
7979

8080
def test_persist_critical_error_all_threads_fail(self):
8181
"""

0 commit comments

Comments
 (0)