Skip to content

Commit 88e3b33

Browse files
fix Jira connector cloud option not working issue (#481)
* fix Jira connector cloud option not working issue * fix lint * temporarily skip mixedbread integration test until it is migrated to new sdk * bump version
1 parent 7b61ad1 commit 88e3b33

File tree

6 files changed

+42
-12
lines changed

6 files changed

+42
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.21
2+
3+
* **Fix Jira connector cloud option not working issue**
4+
15
## 1.0.20
26

37
* **Fix Weaviate connector issue with names being wrongly transformed to match collections naming conventions**

test/integration/connectors/test_jira.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async def test_jira_source(temp_dir):
3939
url=jira_url,
4040
username=user_email,
4141
access_config=access_config,
42+
cloud=True,
4243
)
4344
index_config = JiraIndexerConfig(projects=projects, boards=boards, issues=issues)
4445

test/integration/embedders/test_mixedbread.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def get_api_key() -> str:
2727

2828

2929
@requires_env(API_KEY)
30+
@pytest.mark.skip(reason="need to migrate to new mixedbread sdk.")
3031
def test_mixedbread_embedder(embedder_file: Path):
3132
api_key = get_api_key()
3233
embedder_config = EmbedderConfig(embedding_provider="mixedbread-ai", embedding_api_key=api_key)
@@ -40,6 +41,7 @@ def test_mixedbread_embedder(embedder_file: Path):
4041

4142

4243
@requires_env(API_KEY)
44+
@pytest.mark.skip(reason="need to migrate to new mixedbread sdk.")
4345
def test_raw_mixedbread_embedder(embedder_file: Path):
4446
api_key = get_api_key()
4547
embedder = MixedbreadAIEmbeddingEncoder(
@@ -58,6 +60,7 @@ def test_raw_mixedbread_embedder(embedder_file: Path):
5860

5961
@requires_env(API_KEY)
6062
@pytest.mark.asyncio
63+
@pytest.mark.skip(reason="need to migrate to new mixedbread sdk.")
6164
async def test_raw_async_mixedbread_embedder(embedder_file: Path):
6265
api_key = get_api_key()
6366
embedder = AsyncMixedbreadAIEmbeddingEncoder(

unstructured_ingest/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.20" # pragma: no cover
1+
__version__ = "1.0.21" # pragma: no cover

unstructured_ingest/processes/connectors/jira.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from contextlib import contextmanager
44
from dataclasses import dataclass, field
55
from pathlib import Path
6-
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Union
6+
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Union, cast
77

88
from pydantic import Field, Secret
99

@@ -169,8 +169,28 @@ def model_post_init(self, __context):
169169
def get_client(self) -> Generator["Jira", None, None]:
170170
from atlassian import Jira
171171

172+
class CustomJira(Jira):
173+
"""
174+
Custom Jira class to fix the issue with the get_project_issues_count method.
175+
This class inherits from the original Jira class and overrides the method to
176+
handle the response correctly.
177+
Once the issue is fixed in the original library, this class can be removed.
178+
"""
179+
180+
def __init__(self, *args, **kwargs):
181+
super().__init__(*args, **kwargs)
182+
183+
def get_project_issues_count(self, project: str) -> int:
184+
jql = f'project = "{project}" '
185+
response = self.jql(jql, fields="*none")
186+
response = cast("dict", response)
187+
if "total" in response:
188+
return response["total"]
189+
else:
190+
return len(response["issues"])
191+
172192
access_configs = self.access_config.get_secret_value()
173-
with Jira(
193+
with CustomJira(
174194
url=self.url,
175195
username=self.username,
176196
password=access_configs.password,

uv.lock

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)