fixing crypto nft integration bug (#2639)

Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
This commit is contained in:
James Simmons
2022-09-27 04:04:40 -05:00
committed by GitHub
parent e67e0d8678
commit 6339d088a6

View File

@@ -52,6 +52,9 @@ def get_collection_stats(slug: str) -> pd.DataFrame:
"Creation Date",
"URL",
]
# T his variable is here because sometimes the created dates also have
# milliseconds in the string and we dont it, so this just gets the m,d,y,h,m,s
created_date = collection["created_date"][0:19]
values = [
collection["name"],
"-" if not stats["floor_price"] else float(stats["floor_price"]),
@@ -69,9 +72,7 @@ def get_collection_stats(slug: str) -> pd.DataFrame:
round(float(stats["total_supply"]), 2),
round(float(stats["total_sales"]), 2),
round(float(stats["total_volume"]), 2),
datetime.strptime(
collection["created_date"], "%Y-%m-%dT%H:%M:%S.%f"
).strftime("%b %d, %Y"),
datetime.strptime(created_date, "%Y-%m-%dT%H:%M:%S").strftime("%b %d, %Y"),
"-" if not collection["external_url"] else collection["external_url"],
]
df = pd.DataFrame({"Metric": metrics, "Value": values})