cognite-extractor-utils 7.4.1__py3-none-any.whl → 7.4.2__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.

Potentially problematic release.


This version of cognite-extractor-utils might be problematic. Click here for more details.

@@ -16,5 +16,5 @@
16
16
  Cognite extractor utils is a Python package that simplifies the development of new extractors.
17
17
  """
18
18
 
19
- __version__ = "7.4.1"
19
+ __version__ = "7.4.2"
20
20
  from .base import Extractor
@@ -264,7 +264,7 @@ class IOFileUploadQueue(AbstractUploadQueue):
264
264
 
265
265
  def _upload_bytes(self, size: int, file: BinaryIO, meta_or_apply: FileMetadataOrCogniteExtractorFile) -> None:
266
266
  meta_or_apply, url = self._upload_empty(meta_or_apply)
267
- resp = self._httpx_client.send(self._get_file_upload_request(url, file, size))
267
+ resp = self._httpx_client.send(self._get_file_upload_request(url, file, size, meta_or_apply.mime_type))
268
268
  resp.raise_for_status()
269
269
 
270
270
  def _upload_multipart(self, size: int, file: BinaryIO, meta_or_apply: FileMetadataOrCogniteExtractorFile) -> None:
@@ -281,7 +281,9 @@ class IOFileUploadQueue(AbstractUploadQueue):
281
281
 
282
282
  for url in upload_urls:
283
283
  chunks.next_chunk()
284
- resp = self._httpx_client.send(self._get_file_upload_request(url, chunks, len(chunks)))
284
+ resp = self._httpx_client.send(
285
+ self._get_file_upload_request(url, chunks, len(chunks), meta_or_apply.mime_type)
286
+ )
285
287
  resp.raise_for_status()
286
288
 
287
289
  completed_headers = (
@@ -400,7 +402,9 @@ class IOFileUploadQueue(AbstractUploadQueue):
400
402
  self.files_queued.inc()
401
403
  self.queue_size.set(self.upload_queue_size)
402
404
 
403
- def _get_file_upload_request(self, url_str: str, stream: BinaryIO, size: int) -> Request:
405
+ def _get_file_upload_request(
406
+ self, url_str: str, stream: BinaryIO, size: int, mime_type: Optional[str] = None
407
+ ) -> Request:
404
408
  url = URL(url_str)
405
409
  headers = Headers(self._httpx_client.headers)
406
410
  headers.update(
@@ -412,6 +416,9 @@ class IOFileUploadQueue(AbstractUploadQueue):
412
416
  }
413
417
  )
414
418
 
419
+ if mime_type is not None:
420
+ headers.update({"Content-Type": mime_type})
421
+
415
422
  return Request(
416
423
  method="PUT",
417
424
  url=url,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cognite-extractor-utils
3
- Version: 7.4.1
3
+ Version: 7.4.2
4
4
  Summary: Utilities for easier development of extractors for CDF
5
5
  Home-page: https://github.com/cognitedata/python-extractor-utils
6
6
  License: Apache-2.0
@@ -1,4 +1,4 @@
1
- cognite/extractorutils/__init__.py,sha256=xMvvSXWtbvBeI27mzSQnukO0QT4mE9pEmtOzOULAzAk,739
1
+ cognite/extractorutils/__init__.py,sha256=ulj-H7uJEPJAUJUhJg1funj27thycop0GTNOzJTIAXc,739
2
2
  cognite/extractorutils/_inner_util.py,sha256=gmz6aqS7jDNsg8z4RHgJjMFohDLOMiaU4gMWBhg3xcE,1558
3
3
  cognite/extractorutils/base.py,sha256=q6NU2bPec3WOasVnnIFoh-aUJudVZWZ2R6emz3IRj8Q,16391
4
4
  cognite/extractorutils/configtools/__init__.py,sha256=L-daaqInIsmHcjb2forJeY0fW8tz1mlteOUo7IsWnrU,3059
@@ -20,13 +20,13 @@ cognite/extractorutils/uploader/_metrics.py,sha256=J2LJXb19L_SLSJ_voNIQHYLp0pjxU
20
20
  cognite/extractorutils/uploader/assets.py,sha256=2E90N1kxsaA6Ah4h0_r_dTVhDYY_68ItRWrHYkkltJw,5628
21
21
  cognite/extractorutils/uploader/data_modeling.py,sha256=w35Ix5mu0Cgfn4ywnDyif4VVjo04LVTlkMEevk6ztUs,3639
22
22
  cognite/extractorutils/uploader/events.py,sha256=NZP2tMoU_rh_rb-EZiUBsOT5KdNABHN4c9Oddk0OsdE,5680
23
- cognite/extractorutils/uploader/files.py,sha256=jEZ_QwUnXTsfQ5Xsm03j_vNWTlYBg2gmSxE3MOyoC6s,21765
23
+ cognite/extractorutils/uploader/files.py,sha256=orBa5_8Rh60PjJkGTAbcsgnmOYORwQaiy2atOZ95x48,21983
24
24
  cognite/extractorutils/uploader/raw.py,sha256=wFjF90PFTjmByOWx_Y4_YfDJ2w2jl0EQJ2Tjx2MP2PM,6738
25
25
  cognite/extractorutils/uploader/time_series.py,sha256=HBtQdsQoIOaL-EG5lMsaY-ORwVb0kGiXG86VjE5-_Bg,26815
26
26
  cognite/extractorutils/uploader_extractor.py,sha256=E-mpVvbPg_Tk90U4S9JybV0duptJ2SXE88HB6npE3zI,7732
27
27
  cognite/extractorutils/uploader_types.py,sha256=wxfrsiKPTzG5lmoYtQsxt8Xyj-s5HnaLl8WDzJNrazg,1020
28
28
  cognite/extractorutils/util.py,sha256=T6ef5b7aYJ8yq9swQwybYaLe3YGr3hElsJQy8E-d5Rs,17469
29
- cognite_extractor_utils-7.4.1.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
30
- cognite_extractor_utils-7.4.1.dist-info/METADATA,sha256=KF2LYMRHr4eMaykYRGhHt8RE0mgTB-L6LzfIu_P9tYI,5476
31
- cognite_extractor_utils-7.4.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- cognite_extractor_utils-7.4.1.dist-info/RECORD,,
29
+ cognite_extractor_utils-7.4.2.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
30
+ cognite_extractor_utils-7.4.2.dist-info/METADATA,sha256=cd3oSr3l7x5iL8Bj2B03kRc_J8EERrqI-QHPHsyBDmg,5476
31
+ cognite_extractor_utils-7.4.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
+ cognite_extractor_utils-7.4.2.dist-info/RECORD,,