mirror of
https://github.com/wassname/cachier.git
synced 2026-09-11 12:00:30 +08:00
fix deepsource report
This commit is contained in:
@@ -159,17 +159,17 @@ class _PickleCore(_BaseCore):
|
||||
try:
|
||||
import pandas
|
||||
if isinstance(value, pandas.DataFrame):
|
||||
return(pandas.util.hash_pandas_object(value).sum())
|
||||
return pandas.util.hash_pandas_object(value).sum()
|
||||
except ImportError:
|
||||
pass
|
||||
if hasattr(value, "tobytes"): # For numpy
|
||||
return hash(value.tobytes())
|
||||
elif hasattr(value, "__iter__"): # For iterators
|
||||
if hasattr(value, "__iter__"): # For iterators
|
||||
hash_array = []
|
||||
for elem in value:
|
||||
hash_array.append(value)
|
||||
return tuple(hash_array)
|
||||
elif hasattr(value, "items"): # For dict
|
||||
if hasattr(value, "items"): # For dict
|
||||
hash_array = []
|
||||
for key, elem in value.items:
|
||||
hash_array.append(key)
|
||||
|
||||
@@ -11,24 +11,14 @@
|
||||
# realpath,
|
||||
# dirname
|
||||
# )
|
||||
import os
|
||||
from time import time, sleep
|
||||
from datetime import timedelta
|
||||
from random import random
|
||||
import threading
|
||||
|
||||
try:
|
||||
import queue
|
||||
except ImportError: # python 2
|
||||
import Queue as queue
|
||||
|
||||
from cachier import cachier
|
||||
from cachier.pickle_core import DEF_CACHIER_DIR
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
# Pickle core tests
|
||||
# Numpy and pandas tests
|
||||
|
||||
|
||||
@cachier()
|
||||
|
||||
Reference in New Issue
Block a user