Skip to content

Commit

Permalink
fix: Replace temp file type in user_as_csv method
Browse files Browse the repository at this point in the history
  • Loading branch information
nidemidovich committed Oct 31, 2022
1 parent 6bdb012 commit a01e373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pybotx/bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from uuid import UUID

import httpx
from aiofiles.tempfile import NamedTemporaryFile
from aiofiles.tempfile import SpooledTemporaryFile
from pydantic import ValidationError, parse_obj_as

from pybotx.async_buffer import AsyncBufferReadable, AsyncBufferWritable
Expand Down Expand Up @@ -170,7 +170,7 @@
BotXAPIUsersAsCSVRequestPayload,
UsersAsCSVMethod,
)
from pybotx.constants import BOTX_DEFAULT_TIMEOUT, STICKER_PACKS_PER_PAGE
from pybotx.constants import BOTX_DEFAULT_TIMEOUT, CHUNK_SIZE, STICKER_PACKS_PER_PAGE
from pybotx.converters import optional_sequence_to_list
from pybotx.image_validators import (
ensure_file_content_is_png,
Expand Down Expand Up @@ -1243,7 +1243,7 @@ async def users_as_csv(
botx=botx,
)

async with NamedTemporaryFile("w+") as async_buffer:
async with SpooledTemporaryFile(max_size=CHUNK_SIZE, mode="w+") as async_buffer:
yield (
BotXAPIUserFromCSVResult(**row).to_domain()
async for row in await method.execute(payload, async_buffer)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pybotx"
version = "0.51.1"
version = "0.51.2"
description = "A python library for interacting with eXpress BotX API"
authors = [
"Sidnev Nikolay <[email protected]>",
Expand Down

0 comments on commit a01e373

Please sign in to comment.