Skip to content

Commit 238ae72

Browse files
authored
Merge pull request #658 from atlanhq/bump-to-release-7.0.0
Bump to release `7.0.0`
2 parents b8c6ea0 + 90f8915 commit 238ae72

File tree

5 files changed

+152
-11
lines changed

5 files changed

+152
-11
lines changed

HISTORY.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,121 @@
1+
## 7.0.0 (June 12, 2025)
2+
3+
### New Features
4+
5+
- Added `long` as a new primitive type in the `AtlanCustomAttributePrimitiveType` enum.
6+
- Support for `Unmodeled` Asset types: Introduced `IndistinctAsset` as a fallback model to handle asset types that are not explicitly modeled in the SDK. Previously, such assets would return `None` (e.g: for newly introduced typedefs). With this release, the SDK will now return an `IndistinctAsset` instance containing basic fields such as `guid`, `qualifiedName`, and `typeName`.
7+
8+
### Bug Fixes
9+
10+
- Fixed timestamp-based pagination in search log results when `from + size` exceeds the Elasticsearch window size (10,000 records) due to identical creation times for the first and last records in a retrieved page.
11+
12+
### Breaking Changes
13+
14+
This release includes a **major refactor** that eliminates all usage of `AtlanClient.get_current_client()` and `set_current_client()` (previously implemented using [ContextVar](https://docs.python.org/3/library/contextvars.html) / [thread-local storage](https://docs.python.org/3/library/threading.html#thread-local-data) a.k.a TLS). Although the earlier design was thread-safe, it still required users to explicitly use `PyAtlanThreadPoolExecutor` in multi-threaded environments, resulting in unintuitive patterns and frequent client initialization errors.
15+
16+
The new design simplifies usage by requiring the `client` to be passed explicitly to SDK operations that interact with the Atlan platform.
17+
18+
> [!IMPORTANT]
19+
> ### Affected Areas
20+
> All the following methods or constructors now require a `client` argument due to the removal of `AtlanClient.get_current_client()`:
21+
22+
##### `pyatlan.model.assets`:
23+
24+
- `Referenceable.flush_custom_metadata(client)`
25+
- `Referenceable.get_custom_metadata(client, name)`
26+
- `Referenceable.set_custom_metadata(client, custom_metadata)`
27+
- `CustomMetadataProxy` is no longer initialized in `Referenceable.__init__()` (as it now requires a `client`).
28+
- `Purpose.create_metadata_policy()`
29+
- `Purpose.create_data_policy()`
30+
- `DataProduct.get_assets()`
31+
- `Badge.creator()`
32+
- `Connection.creator()`
33+
34+
> [!NOTE]
35+
> `user_cache.validate_names`, `role_cache.validate_idstrs`, and `group_cache.validate_aliases` are now invoked inside `Connection.creator()` instead of field validators.
36+
37+
##### `pyatlan.model.custom_metadata`:
38+
39+
- `CustomMetadataDict(client, name)`
40+
- `CustomMetadataProxy(client, business_attributes)`
41+
42+
##### `pyatlan.model.structs`:
43+
44+
- `SourceTagAttachment.by_name()`
45+
- `SourceTagAttachment.by_qualified_name()`
46+
- `SourceTagName()` (constructor)
47+
48+
##### `pyatlan.model.suggestions`:
49+
50+
- `Suggestions.get()`
51+
- `Suggestions.apply()`
52+
53+
##### `pyatlan.model.fluent_search`
54+
55+
- `FluentSearch.tagged()`
56+
- `FluentSearch.tagged_with_value()`
57+
58+
##### `pyatlan.client.typedef`
59+
60+
- `EnumDef.update()`
61+
- `AttributeDef.create()`
62+
63+
##### `pyatlan.model.search`
64+
65+
- `Exists.with_custom_metadata()`
66+
- `Term.with_custom_metadata()`
67+
68+
##### `pyatlan.client.atlan`
69+
70+
- `client_connection()`
71+
72+
##### `pyatlan.model.open_lineage`
73+
74+
- `OpenLineageEvent.emit()`
75+
76+
##### `pyatlan.model.fields.atlan_fields`
77+
78+
- `CustomMetadataField()` (constructor)
79+
80+
##### `pyatlan.model.packages`
81+
82+
- All crawler class constructors
83+
84+
### Serialization & Deserialization
85+
86+
#### API Serialization:
87+
88+
- Now handled via the `AtlanRequest` wrapper, which takes a Pydantic model instance and a client.
89+
- It automatically performs translation (e.g: converting human-readable Atlan tag names into hashed IDs using `AtlanTagRetranslator`).
90+
91+
#### API Response Deserialization:
92+
93+
- Responses are processed using the `AtlanResponse` wrapper.
94+
- It translates raw JSON into readable formats via registered translators like `AtlanTagTranslator` (e.g: converting hashed tag IDs into human-readable names).
95+
96+
### AtlanTag / AtlanTagName Changes
97+
98+
- **Human-readable tag names** are now only available when deserializing through `AtlanResponse` (which requires a valid `client`). If skipped, tag names remain in **hashed ID format** or as plain strings.
99+
- Deleted tags (e.g `AtlanTagName('(DELETED)')`) will only appear when using `AtlanResponse`, as the lookup requires a client to determine tag validity.
100+
- The `.id` attribute on `AtlanTagName` has been **deprecated**. Use `AtlanTag.tag_id` to access the hashed ID instead.
101+
- Fixed typo in `AtlanTag.source_tag_attachments` field name.
102+
103+
### Other Changes
104+
105+
- `AtlanClient._401_has_retried` is now marked as a `PrivateAttr`.
106+
- `IndexSearchRequest.Metadata` has been moved to a separate class: `IndexSearchRequestMetadata`.
107+
- Removed deprecated methods:
108+
109+
- `AtlanClient.get_current_client()`
110+
- `AtlanClient.set_current_client()`
111+
- `PyAtlanThreadPoolExecutor` (SDK is now fully thread-safe without it)
112+
- Updated `AssetClient.find_domain_by_name()` and `AssetClient.find_product_by_name()` to return only active `Domain` and `Product` assets. Previously, these methods returned both `active` and `archived` assets, which caused issues when assets with the same `name` existed in both states - the first match (possibly `archived`) was returned.
113+
114+
### QOL Improvements
115+
116+
- Regenerated latest typedef models.
117+
- Refactored integration and unit tests to eliminate reliance on `AtlanClient.get_current_client()` / `set_current_client()`.
118+
1119
## 6.2.1 (May 30, 2025)
2120

3121
### Bug Fixes

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ This repository houses the code for a Python SDK to interact with [Atlan](https:
1111

1212
[https://developer.atlan.com/getting-started/python-sdk/](https://developer.atlan.com/getting-started/python-sdk/)
1313

14-
15-
1614
## Installing for Development
1715

1816
### Initial Setup
@@ -44,7 +42,7 @@ To get started developing the SDK:
4442
# Upgrade pip before installing dependencies
4543
python -m pip install --upgrade pip
4644
# Install required dependencies for development
47-
pip install -e . && pip install -r requirements-dev.txt
45+
pip install -e . && pip install -r requirements-dev.txt
4846
```
4947

5048
### Code Formatting
@@ -69,11 +67,11 @@ For running integration tests, you'll need to configure your environment:
6967
```
7068
- For Windows (PowerShell): Load environment variables
7169
```powershell
72-
# Run this in PowerShell (not Command Prompt)
73-
Get-Content .env | ForEach-Object {
74-
if ($_ -match '^(.*?)=(.*)$') {
75-
$env:($matches[1]) = $matches[2]
76-
}
70+
# Run this in PowerShell (not Command Prompt)
71+
Get-Content .env | ForEach-Object {
72+
if ($_ -match '^(.*?)=(.*)$') {
73+
$env:($matches[1]) = $matches[2]
74+
}
7775
}
7876
```
7977
- For macOS/Linux: Load environment variables from .env file
@@ -110,6 +108,31 @@ Once the environment is set up, you can run integration tests:
110108
pytest tests/integration/<test_specific_feature>.py
111109
```
112110
111+
### Running the SDK Model Generator
112+
113+
If you've pushed new typedefs to Atlan and want to generate SDK asset models to manage them via the SDK, this section covers how to run the SDK generator.
114+
115+
> [!NOTE]
116+
> Before running any generator scripts, make sure you have [configured your environment variables](https://developer.atlan.com/sdks/python/#configure-the-sdk) specifically `ATLAN_BASE_URL` and `ATLAN_API_KEY`.
117+
118+
1. Retrieve the typedefs from your Atlan instance and save them to a JSON file by running:
119+
120+
```shell
121+
python3 pyatlan/generator/create_typedefs_file.py
122+
```
123+
124+
2. Generate the asset `models`, `enums`, and `struct` modules in the SDK based on the typedefs by running:
125+
126+
```shell
127+
python3 pyatlan/generator/class_generator.py
128+
```
129+
130+
3. The generated files will be unformatted. To format them properly, run the formatter:
131+
132+
```shell
133+
./pyatlan-formatter
134+
```
135+
113136
## Attribution
114137
115138
Portions of the SDK are based on original work from https://github.com/apache/atlas. Those classes that derive from this original work have an extra heading comment as follows:

pyatlan/generator/templates/methods/asset/data_product.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
def get_assets(self, client: AtlanClient):
8989
"""
90-
Reterieves list of all assets linked to the provided data product.
90+
Retrieves list of all assets linked to the provided data product.
9191

9292
:param client: connectivity to an Atlan tenant
9393
:raises InvalidRequestError: if DataProduct asset DSL cannot be found (does not exist) in Atlan

pyatlan/model/assets/core/data_product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def create_for_modification(
127127

128128
def get_assets(self, client: AtlanClient):
129129
"""
130-
Reterieves list of all assets linked to the provided data product.
130+
Retrieves list of all assets linked to the provided data product.
131131
132132
:param client: connectivity to an Atlan tenant
133133
:raises InvalidRequestError: if DataProduct asset DSL cannot be found (does not exist) in Atlan

pyatlan/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.2.1
1+
7.0.0

0 commit comments

Comments
 (0)