fix: uploading xlsx with font bigger than 14
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from openpyxl.reader.excel import load_workbook
|
from openpyxl.reader.excel import load_workbook
|
||||||
from openpyxl.utils.cell import get_column_letter
|
from openpyxl.utils.cell import get_column_letter
|
||||||
@@ -133,7 +134,10 @@ class DealParser:
|
|||||||
return rows
|
return rows
|
||||||
|
|
||||||
async def parse(self, file_bytes: bytes) -> ParseDealsExcelResponse:
|
async def parse(self, file_bytes: bytes) -> ParseDealsExcelResponse:
|
||||||
wb = load_workbook(filename=BytesIO(file_bytes))
|
p = mock.patch('openpyxl.styles.fonts.Font.family.max', new=100)
|
||||||
|
p.start()
|
||||||
|
|
||||||
|
wb = load_workbook(filename=BytesIO(file_bytes), data_only=True)
|
||||||
ws = wb.worksheets[0]
|
ws = wb.worksheets[0]
|
||||||
|
|
||||||
await self._parse_warehouses_and_marketplaces(ws)
|
await self._parse_warehouses_and_marketplaces(ws)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ alembic
|
|||||||
python-dotenv
|
python-dotenv
|
||||||
aiohttp
|
aiohttp
|
||||||
aiohttp[speedups]
|
aiohttp[speedups]
|
||||||
openpyxl
|
openpyxl==3.0.10
|
||||||
lexorank-py
|
lexorank-py
|
||||||
celery[redis]
|
celery[redis]
|
||||||
celery
|
celery
|
||||||
|
|||||||
Reference in New Issue
Block a user