From a5dd22b1c511b719c91973a23d2ea6855aaf9607 Mon Sep 17 00:00:00 2001 From: kiurieva Date: Thu, 7 Dec 2023 15:29:04 +0100 Subject: [PATCH 1/2] Fixed json normalize --- viadot/sources/vid_club.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/viadot/sources/vid_club.py b/viadot/sources/vid_club.py index 4da4e4f45..b32ee01b1 100644 --- a/viadot/sources/vid_club.py +++ b/viadot/sources/vid_club.py @@ -230,7 +230,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 @@ -246,7 +246,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() From 2fa2367f637910b1fa7af36709859f0266290f39 Mon Sep 17 00:00:00 2001 From: kiurieva Date: Wed, 17 Jan 2024 09:29:04 +0100 Subject: [PATCH 2/2] Deleted unused libraries import --- viadot/sources/vid_club.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/viadot/sources/vid_club.py b/viadot/sources/vid_club.py index b32ee01b1..6cd3c00a5 100644 --- a/viadot/sources/vid_club.py +++ b/viadot/sources/vid_club.py @@ -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