Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/core/garf_core/api_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import csv
import json
import os
import pathlib
from collections.abc import Sequence
from typing import Any, Union

import pydantic
import requests
import smart_open
from typing_extensions import TypeAlias, override

from garf_core import exceptions, query_editor
Expand Down Expand Up @@ -124,7 +124,7 @@ def from_json(cls, file_location: str | os.PathLike[str]) -> FakeApiClient:
GarfApiError: When file with data not found.
"""
try:
with pathlib.Path.open(file_location, 'r', encoding='utf-8') as f:
with smart_open.open(file_location, 'r', encoding='utf-8') as f:
data = json.load(f)
return FakeApiClient(data)
except FileNotFoundError as e:
Expand All @@ -144,7 +144,7 @@ def from_csv(cls, file_location: str | os.PathLike[str]) -> FakeApiClient:
GarfApiError: When file with data not found.
"""
try:
with pathlib.Path.open(file_location, 'r', encoding='utf-8') as f:
with smart_open.open(file_location, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
data = []
for row in reader:
Expand Down
Loading