|
| 1 | +## 6.0.0 (February 20, 2025) |
| 2 | + |
| 3 | +### New Features |
| 4 | + |
| 5 | +- Added a new connector type: `DOCUMENTDB`. |
| 6 | + |
| 7 | +### Breaking Changes |
| 8 | + |
| 9 | +- `DataProduct.get_assets()` method now raises `InvalidRequestError` when there is a missing value for `data_product_assets_d_s_l`, which is required to retrieve product assets. |
| 10 | +- Fixed SDK cache inconsistencies and unexpected behavior when running in concurrent/multi-threaded environments. |
| 11 | + |
| 12 | + - Completely migrated from `AtlanClient._default_client` to `AtlanClient._current_client_tls` (which uses thread-local storage) to prevent sharing this class variable across multiple threads. Previously, it was shared across threads, resulting in inconsistent behavior in SDK caches. |
| 13 | + - Removed `cache_key` maintenance that used to maintain cache instances per Atlan client hash (`cache_key(base_url, api_key)`). |
| 14 | + - Now, all caches are bound to an `AtlanClient` instance, requiring the migration of all cache methods from class methods to instance methods. |
| 15 | + - Caches remain tracked even in cases of automatic token refresh for the client. |
| 16 | + |
| 17 | + The following example illustrates the migration: |
| 18 | + |
| 19 | + ### Before |
| 20 | + |
| 21 | + ```py |
| 22 | + from pyatlan.cache.atlan_tag_cache import AtlanTagCache |
| 23 | + |
| 24 | + c1 = AtlanClient() |
| 25 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # <-- Uses default client (c1), populates the caches (API call), and uses cache_key to store the cache instance |
| 26 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # Returns the ID from the cache (no API call) |
| 27 | + |
| 28 | + c2 = AtlanClient() |
| 29 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # <-- Uses default client (c2), populates the caches, and uses cache_key to store the cache instance |
| 30 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # Returns the ID from the cache (no API call) |
| 31 | + |
| 32 | + c1 = AtlanClient() |
| 33 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # <-- c1 initialized again. Since cache_key was used for c1 previously, the populated cache instance in memory is reused, avoiding an API call. |
| 34 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # Returns the ID from the cache (no API call) |
| 35 | + ``` |
| 36 | + |
| 37 | + ### Now (caches are bound to the client and maintained only upon the first client initialization): |
| 38 | + |
| 39 | + ```py |
| 40 | + c1 = AtlanClient() |
| 41 | + |
| 42 | + tag_id = c1.atlan_tag_cache.get_id_for_name(atlan_tag_name) # <-- Uses default client (c1) and populates the caches (API call) |
| 43 | + |
| 44 | + # OR |
| 45 | + tag_id = AtlanClient.get_current_client().atlan_tag_cache.get_id_for_name(atlan_tag_name) # <-- Uses default client (c1) and populates the caches (API call) |
| 46 | + tag_id = AtlanTagCache.get_id_for_name(atlan_tag_name) # Returns the ID from the cache (no API call) |
| 47 | + |
| 48 | + c2 = AtlanClient() |
| 49 | + tag_id = c2.atlan_tag_cache.get_id_for_name(atlan_tag_name) # <-- Uses default client (c2) and populates the cache (API call) |
| 50 | + tag_id = c2.atlan_tag_cache.get_id_for_name(atlan_tag_name) # Returns the ID from the cache (no API call) |
| 51 | + |
| 52 | + c1 = AtlanClient() |
| 53 | + tag_id = c1.atlan_tag_cache.get_id_for_name(atlan_tag_name) # <-- c1 initialized again. Since no cache_key is used in the latest approach, the previously populated cache instance is gone, and we need to make an API call to populate the cache for c1. |
| 54 | + tag_id = c1.atlan_tag_cache.get_id_for_name(atlan_tag_name) # Returns the ID from the cache (no API call) |
| 55 | + ``` |
| 56 | + |
1 | 57 | ## 5.0.2 (March 11, 2025)
|
2 | 58 |
|
3 | 59 | ### New Features
|
|
0 commit comments