Skip to content

Commit

Permalink
Merge pull request #829 from KaterynaIurieva/fix_json_normalize
Browse files Browse the repository at this point in the history
Fixed json normalize
  • Loading branch information
Rafalz13 authored Jan 17, 2024
2 parents cd60a85 + 2fa2367 commit 0fe61b3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions viadot/sources/vid_club.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import json
import os
import urllib
from pandas.io.json import json_normalize
from datetime import date, datetime, timedelta
from datetime import datetime, timedelta
from typing import Any, Dict, List, Literal, Tuple

import pandas as pd
from prefect.utilities import logging

from ..exceptions import CredentialError, ValidationError
from ..exceptions import ValidationError
from ..utils import handle_api_response
from .base import Source

Expand Down Expand Up @@ -230,7 +226,7 @@ def get_response(
ind = False

if "data" in keys_list:
df = json_normalize(response["data"])
df = pd.json_normalize(response["data"])
df = pd.DataFrame(df)
length = df.shape[0]
page = 1
Expand All @@ -246,7 +242,7 @@ def get_response(
url=url, headers=headers, method="GET", verify=False
)
response = r.json()
df_page = json_normalize(response["data"])
df_page = pd.json_normalize(response["data"])
df_page = pd.DataFrame(df_page)
if source == "product":
df_page = df_page.transpose()
Expand Down

0 comments on commit 0fe61b3

Please sign in to comment.