unstructured-ingest 1.0.23__py3-none-any.whl → 1.0.24__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unstructured_ingest/__version__.py +1 -1
- unstructured_ingest/processes/connectors/jira.py +22 -34
- {unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/METADATA +1 -1
- {unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/RECORD +7 -7
- {unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/WHEEL +0 -0
- {unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/entry_points.txt +0 -0
- {unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.0.
|
|
1
|
+
__version__ = "1.0.24" # pragma: no cover
|
|
@@ -3,7 +3,7 @@ from contextlib import contextmanager
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from time import time
|
|
6
|
-
from typing import TYPE_CHECKING, Any, Callable, Generator, List, Optional, Union
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Callable, Generator, List, Optional, Union
|
|
7
7
|
|
|
8
8
|
from pydantic import BaseModel, Field, Secret
|
|
9
9
|
|
|
@@ -139,28 +139,8 @@ class JiraConnectionConfig(ConnectionConfig):
|
|
|
139
139
|
def get_client(self) -> Generator["Jira", None, None]:
|
|
140
140
|
from atlassian import Jira
|
|
141
141
|
|
|
142
|
-
class CustomJira(Jira):
|
|
143
|
-
"""
|
|
144
|
-
Custom Jira class to fix the issue with the get_project_issues_count method.
|
|
145
|
-
This class inherits from the original Jira class and overrides the method to
|
|
146
|
-
handle the response correctly.
|
|
147
|
-
Once the issue is fixed in the original library, this class can be removed.
|
|
148
|
-
"""
|
|
149
|
-
|
|
150
|
-
def __init__(self, *args, **kwargs):
|
|
151
|
-
super().__init__(*args, **kwargs)
|
|
152
|
-
|
|
153
|
-
def get_project_issues_count(self, project: str) -> int:
|
|
154
|
-
jql = f'project = "{project}" '
|
|
155
|
-
response = self.jql(jql, fields="*none")
|
|
156
|
-
response = cast("dict", response)
|
|
157
|
-
if "total" in response:
|
|
158
|
-
return response["total"]
|
|
159
|
-
else:
|
|
160
|
-
return len(response["issues"])
|
|
161
|
-
|
|
162
142
|
access_configs = self.access_config.get_secret_value()
|
|
163
|
-
with
|
|
143
|
+
with Jira(
|
|
164
144
|
url=self.url,
|
|
165
145
|
username=self.username,
|
|
166
146
|
password=access_configs.password,
|
|
@@ -206,13 +186,21 @@ class JiraIndexer(Indexer):
|
|
|
206
186
|
)
|
|
207
187
|
logger.info("Connection to Jira successful.")
|
|
208
188
|
|
|
209
|
-
def
|
|
189
|
+
def run_jql(self, jql: str, **kwargs) -> Generator[JiraIssueMetadata, None, None]:
|
|
210
190
|
with self.connection_config.get_client() as client:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
191
|
+
if client.cloud:
|
|
192
|
+
for issue in api_token_based_generator(client.enhanced_jql, jql=jql, **kwargs):
|
|
193
|
+
yield JiraIssueMetadata.model_validate(issue)
|
|
194
|
+
else:
|
|
195
|
+
for issue in api_page_based_generator(client.jql, jql=jql, **kwargs):
|
|
196
|
+
yield JiraIssueMetadata.model_validate(issue)
|
|
197
|
+
|
|
198
|
+
def _get_issues_within_projects(self) -> Generator[JiraIssueMetadata, None, None]:
|
|
199
|
+
fields = ["key", "id", "status"]
|
|
200
|
+
jql = "project in ({})".format(", ".join(self.index_config.projects))
|
|
201
|
+
jql = self._update_jql(jql)
|
|
202
|
+
logger.debug(f"running jql: {jql}")
|
|
203
|
+
return self.run_jql(jql=jql, fields=fields)
|
|
216
204
|
|
|
217
205
|
def _get_issues_within_single_board(self, board_id: str) -> List[JiraIssueMetadata]:
|
|
218
206
|
with self.connection_config.get_client() as client:
|
|
@@ -223,6 +211,7 @@ class JiraIndexer(Indexer):
|
|
|
223
211
|
)
|
|
224
212
|
else:
|
|
225
213
|
jql = "ORDER BY id"
|
|
214
|
+
logger.debug(f"running jql for board {board_id}: {jql}")
|
|
226
215
|
for issue in api_page_based_generator(
|
|
227
216
|
fn=client.get_issues_for_board, board_id=board_id, fields=fields, jql=jql
|
|
228
217
|
):
|
|
@@ -244,12 +233,11 @@ class JiraIndexer(Indexer):
|
|
|
244
233
|
return jql
|
|
245
234
|
|
|
246
235
|
def _get_issues_by_keys(self) -> Generator[JiraIssueMetadata, None, None]:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
yield JiraIssueMetadata.model_validate(issue)
|
|
236
|
+
fields = ["key", "id"]
|
|
237
|
+
jql = "key in ({})".format(", ".join(self.index_config.issues))
|
|
238
|
+
jql = self._update_jql(jql)
|
|
239
|
+
logger.debug(f"running jql: {jql}")
|
|
240
|
+
return self.run_jql(jql=jql, fields=fields)
|
|
253
241
|
|
|
254
242
|
def _create_file_data_from_issue(self, issue: JiraIssueMetadata) -> FileData:
|
|
255
243
|
# Build metadata
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
unstructured_ingest/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
2
|
-
unstructured_ingest/__version__.py,sha256=
|
|
2
|
+
unstructured_ingest/__version__.py,sha256=p1Nz9H4WBA_aI3GL1htUsWwzMmx5t9ktPqeOxmax3ms,43
|
|
3
3
|
unstructured_ingest/error.py,sha256=qDncnJgbf5ils956RcO2CGlAKYDT5OaEM9Clv1JVTNc,1448
|
|
4
4
|
unstructured_ingest/errors_v2.py,sha256=9RuRCi7lbDxCguDz07y5RiHoQiFIOWwOD7xqzJ2B3Yw,436
|
|
5
5
|
unstructured_ingest/logger.py,sha256=7e_7UeK6hVOd5BQ6i9NzRUAPCS_DF839Y8TjUDywraY,1428
|
|
@@ -73,7 +73,7 @@ unstructured_ingest/processes/connectors/discord.py,sha256=6yEJ_agfKUqsV43wFsbMk
|
|
|
73
73
|
unstructured_ingest/processes/connectors/github.py,sha256=smHCz6jOH1p_hW2S25bYunBBj_pYjz8HTw6wkzaJz_A,7765
|
|
74
74
|
unstructured_ingest/processes/connectors/gitlab.py,sha256=6h1CdqznJmzeWxGfXrFLdNdT23PExGnUMMX7usK_4Kk,10013
|
|
75
75
|
unstructured_ingest/processes/connectors/google_drive.py,sha256=BIFBZGp26JlBBOcXy5Gq0UoNzWv6pwRKhEAHMVMI2_M,25050
|
|
76
|
-
unstructured_ingest/processes/connectors/jira.py,sha256=
|
|
76
|
+
unstructured_ingest/processes/connectors/jira.py,sha256=a7OuVi4RFfr22Tqgk60lwmtWTRBw2fI1m8KPqfA8Ffo,18504
|
|
77
77
|
unstructured_ingest/processes/connectors/kdbai.py,sha256=XhxYpKSAoFPBsDQWwNuLX03DCxOVr7yquj9VYM55Rtc,5174
|
|
78
78
|
unstructured_ingest/processes/connectors/local.py,sha256=LluTLKv4g7FbJb4A6vuSxI9VhzKZuuQUpDS-cVNAQ2g,7426
|
|
79
79
|
unstructured_ingest/processes/connectors/milvus.py,sha256=Jr9cul7By03tGAPFnFBoqncnNWwbhKd-qbmkuqnin8U,8908
|
|
@@ -231,8 +231,8 @@ unstructured_ingest/utils/ndjson.py,sha256=nz8VUOPEgAFdhaDOpuveknvCU4x82fVwqE01q
|
|
|
231
231
|
unstructured_ingest/utils/pydantic_models.py,sha256=BT_j15e4rX40wQbt8LUXbqfPhA3rJn1PHTI_G_A_EHY,1720
|
|
232
232
|
unstructured_ingest/utils/string_and_date_utils.py,sha256=oXOI6rxXq-8ncbk7EoJK0WCcTXWj75EzKl8pfQMID3U,2522
|
|
233
233
|
unstructured_ingest/utils/table.py,sha256=WZechczgVFvlodUWFcsnCGvBNh1xRm6hr0VbJTPxKAc,3669
|
|
234
|
-
unstructured_ingest-1.0.
|
|
235
|
-
unstructured_ingest-1.0.
|
|
236
|
-
unstructured_ingest-1.0.
|
|
237
|
-
unstructured_ingest-1.0.
|
|
238
|
-
unstructured_ingest-1.0.
|
|
234
|
+
unstructured_ingest-1.0.24.dist-info/METADATA,sha256=Ssmaf7onq6HIFmhR7f2mMPoS2gqGy6dmvxo605W_dWU,8691
|
|
235
|
+
unstructured_ingest-1.0.24.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
236
|
+
unstructured_ingest-1.0.24.dist-info/entry_points.txt,sha256=gUAAFnjFPnBgThJSEbw0N5ZjxtaKlT1s9e05_arQrNw,70
|
|
237
|
+
unstructured_ingest-1.0.24.dist-info/licenses/LICENSE.md,sha256=SxkKP_62uIAKb9mb1eH7FH4Kn2aYT09fgjKpJt5PyTk,11360
|
|
238
|
+
unstructured_ingest-1.0.24.dist-info/RECORD,,
|
|
File without changes
|
{unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{unstructured_ingest-1.0.23.dist-info → unstructured_ingest-1.0.24.dist-info}/licenses/LICENSE.md
RENAMED
|
File without changes
|