Skip to content

Commit 8f0b4f6

Browse files
committed
Compatibility with RavenPack Edge
1 parent 15b84c1 commit 8f0b4f6

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

CHANGELOG.md

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

3+
## v1.0.46 (2021-04-05)
4+
Compatibility with RavenPack Edge
5+
6+
* loosen validation for entity-types (in Edge we have various dynamical
7+
EDETs)
8+
9+
* loosen validation for RT fields (in Edge we have several new fields)
10+
11+
312
## v1.0.43 (2020-11-04)
413

514
* Entity-mapping - expose the matching score and the candidates

ravenpackapi/core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
from ravenpackapi.models.results import Results
1111
from ravenpackapi.upload.module import UploadApi
1212
from ravenpackapi.util import to_curl
13-
from ravenpackapi.utils.constants import ENTITY_TYPES
1413
from ravenpackapi.utils.date_formats import as_datetime_str
1514
from ravenpackapi.utils.dynamic_sessions import DynamicSession
1615

1716
_VALID_METHODS = ('get', 'post', 'put', 'delete', 'patch')
18-
VERSION = '1.0.45'
17+
VERSION = '1.0.46'
1918

2019
logger = logging.getLogger("ravenpack.core")
2120

@@ -175,7 +174,6 @@ def get_entity_reference(self, rp_entity_id):
175174
def get_entity_type_reference(self, entity_type=None):
176175
if entity_type:
177176
entity_type = entity_type.upper()
178-
assert entity_type in ENTITY_TYPES, "Please provide a valid entity type, one of %s" % ENTITY_TYPES
179177
response = self.request(
180178
endpoint="/entity-reference",
181179
method='get',

ravenpackapi/models/results.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def __str__(self):
4646
def __getattr__(self, field):
4747
normalized_field = field.upper()
4848
analytics_field = FIELD_MAP.get(normalized_field)
49+
if normalized_field not in FIELD_MAP: # accessing unknown fields - i.e. Edge ones
50+
return self.data[field]
4951
if analytics_field is None:
5052
return self.__getattribute__(field)
5153

ravenpackapi/utils/constants.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
VERSION = '1.0.45'
3+
VERSION = '1.0.46'
44

55
with open('README.rst') as readme_file:
66
readme = readme_file.read()

0 commit comments

Comments
 (0)