Skip to content

Commit

Permalink
Merge pull request #387 from atlanhq/bump-to-release-2.4.5
Browse files Browse the repository at this point in the history
Bump to release `2.4.5`
  • Loading branch information
Aryamanz29 authored Sep 18, 2024
2 parents 64a0cb3 + 09d0a91 commit 0605e6a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
14 changes: 14 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 2.4.5 (September 18, 2024)

### New Features

- Added `username` property to the `ApiToken` model.
- Added functions for validating custom package files to `pyatlan.test_utils`.
- Added an optional parameter `asset_selection` to `DataProduct.updater()`, allowing users to update assets within the data product.
- Added the `DataProductsAssetsDSL.get_asset_selection()` method, which returns the asset selection DSL string for a data product based on the specified `IndexSearchRequest`.

### Bug Fixes

- Fixed pagination issues in `AuditSearchResults`.
- Fixed multipart form handling for `AtlanTag` image uploads.

## 2.4.4 (September 10, 2024)

### New features
Expand Down
2 changes: 1 addition & 1 deletion pyatlan/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.4
2.4.5
32 changes: 32 additions & 0 deletions tests/integration/custom_package_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
import importlib.util
import os
from pathlib import Path
from unittest.mock import MagicMock, patch

import pytest

from pyatlan.client.atlan import AtlanClient
from pyatlan.pkg.models import CustomPackage, generate
from pyatlan.pkg.ui import UIConfig, UIStep
from pyatlan.pkg.utils import set_package_headers
from pyatlan.pkg.widgets import TextInput


@pytest.fixture
def mock_pkg_env():
with patch.dict(
os.environ,
{
"X_ATLAN_AGENT": "agent_value",
"X_ATLAN_AGENT_ID": "agent_id_value",
"X_ATLAN_AGENT_PACKAGE_NAME": "package_name_value",
"X_ATLAN_AGENT_WORKFLOW_ID": "workflow_id_value",
},
clear=True,
):
yield


@pytest.fixture
def custom_package():
return CustomPackage(
Expand Down Expand Up @@ -72,3 +91,16 @@ def test_generate_config(custom_package: CustomPackage, tmpdir):
assert module is not None
assert spec.loader is not None
spec.loader.exec_module(module)


def test_set_package_headers(client: AtlanClient, mock_pkg_env):
mock_client = MagicMock(spec=client)
updated_client = set_package_headers(mock_client)
expected_headers = {
"x-atlan-agent": "agent_value",
"x-atlan-agent-id": "agent_id_value",
"x-atlan-agent-package-name": "package_name_value",
"x-atlan-agent-workflow-id": "workflow_id_value",
}
mock_client.update_headers.assert_called_once_with(expected_headers)
assert updated_client == mock_client

0 comments on commit 0605e6a

Please sign in to comment.