#1128 | Remove deprecated type hints from typing module (#1131)

This commit is contained in:
Sandra Serrano
2024-01-09 18:35:24 +01:00
committed by GitHub
parent c9df7a2020
commit 0de9491c61
41 changed files with 272 additions and 267 deletions

View File

@@ -2,7 +2,7 @@ import hashlib
import json
import os
import re
from typing import Dict, List, Union
from typing import Union
import requests
@@ -16,14 +16,14 @@ class JSONReader:
pass
@staticmethod
def load_data(json_data: Union[Dict, str]) -> List[str]:
def load_data(json_data: Union[dict, str]) -> list[str]:
"""Load data from a JSON structure.
Args:
json_data (Union[Dict, str]): The JSON data to load.
json_data (Union[dict, str]): The JSON data to load.
Returns:
List[str]: A list of strings representing the leaf nodes of the JSON.
list[str]: A list of strings representing the leaf nodes of the JSON.
"""
if isinstance(json_data, str):
json_data = json.loads(json_data)