From 63232fb0903e10f5456dd8d85da1c0ec65621b54 Mon Sep 17 00:00:00 2001 From: Kevin Yan Date: Mon, 30 Oct 2023 23:40:49 +0000 Subject: [PATCH] Remove pyrsistent --- deltacat/tests/utils/test_metrics.py | 6 ------ deltacat/utils/metrics.py | 5 ++--- requirements.txt | 1 - setup.py | 1 - 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/deltacat/tests/utils/test_metrics.py b/deltacat/tests/utils/test_metrics.py index 066c0cd1..a277df7d 100644 --- a/deltacat/tests/utils/test_metrics.py +++ b/deltacat/tests/utils/test_metrics.py @@ -57,9 +57,3 @@ def test_metrics_config_immutability(self): metrics_config.metrics_target = MetricsTarget.CLOUDWATCH with self.assertRaises(Exception): metrics_config.metrics_namespace = "test_namespace" - with self.assertRaises(Exception): - metrics_config.metrics_dimensions = [] - with self.assertRaises(Exception): - metrics_config.metrics_dimensions[0] = {"Name": "Value"} - with self.assertRaises(Exception): - metrics_config.metrics_kwargs["test"] = "test" diff --git a/deltacat/utils/metrics.py b/deltacat/utils/metrics.py index 568e62c5..85d4c244 100644 --- a/deltacat/utils/metrics.py +++ b/deltacat/utils/metrics.py @@ -12,7 +12,6 @@ from typing import Dict, Any, List, Callable from deltacat.aws.clients import resource_cache from datetime import datetime -import pyrsistent from ray.util import get_node_ip_address @@ -45,8 +44,8 @@ def __init__( # Pyrsistent is unable to enforce immutability on nested objects # Please avoid modifying stored objects to preserve read-only status - self.metrics_dimensions = pyrsistent.v(*metrics_dimensions) - self.metrics_kwargs = pyrsistent.m(**metrics_kwargs) + self.metrics_dimensions = metrics_dimensions + self.metrics_kwargs = metrics_kwargs # Enforce fields to be read-only after initialization def __setattr__(self, __name: str, __value: Any) -> None: diff --git a/requirements.txt b/requirements.txt index ecedb481..c06df747 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,6 @@ pandas == 1.3.5 pyarrow == 12.0.1 pydantic == 1.10.4 pymemcache == 4.0.0 -pyrsistent == 0.19.3 ray[default] ~= 2.0 redis == 4.6.0 s3fs == 2022.2.0 diff --git a/setup.py b/setup.py index dac00ce8..367a1c8f 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,6 @@ def find_version(*paths): "pyarrow == 12.0.1", "pydantic == 1.10.4", "pymemcache == 4.0.0", - "pyrsistent == 0.19.3", "ray[default] ~= 2.0", "s3fs == 2022.2.0", "tenacity == 8.1.0",