mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-12 09:23:52 +00:00
fix(ingest): handle redaction of configs with int keys (#8545)
This commit is contained in:
parent
c77b0d0260
commit
ef15861d0d
@ -2,7 +2,7 @@ import re
|
|||||||
import unittest.mock
|
import unittest.mock
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from enum import auto
|
from enum import auto
|
||||||
from typing import IO, Any, ClassVar, Dict, List, Optional, Type, TypeVar
|
from typing import IO, Any, ClassVar, Dict, List, Optional, Type, TypeVar, Union
|
||||||
|
|
||||||
import pydantic
|
import pydantic
|
||||||
from cached_property import cached_property
|
from cached_property import cached_property
|
||||||
@ -31,8 +31,10 @@ REDACT_SUFFIXES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _should_redact_key(key: str) -> bool:
|
def _should_redact_key(key: Union[str, int]) -> bool:
|
||||||
return key in REDACT_KEYS or any(key.endswith(suffix) for suffix in REDACT_SUFFIXES)
|
return isinstance(key, str) and (
|
||||||
|
key in REDACT_KEYS or any(key.endswith(suffix) for suffix in REDACT_SUFFIXES)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _redact_value(value: Any) -> Any:
|
def _redact_value(value: Any) -> Any:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user