mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 15:36:43 +00:00
* upd sources, convert blocks to loop model, fix collections history * multiple external tbl query macro and blocks update * del network version.yml output * add back rt blocks * lower blocks * revert str blocks and collections and move change to history view * bronze history views and move into folders * history workflow - blocks * del history step from streamline blocks * create complete get history models and upd get history streamline views - BLOCKS * upd remaining method get history views to use history complete tables * upd txs history dependency note * upd history gha and del parameterized models * fix collections external table config * collections template fix * upd txs templates * upd history views * fix to tx results template / views * set history schedule to hourly * del commented out backfill from streamline RT GHAs * move blocks filter up to cte
27 lines
794 B
Python
27 lines
794 B
Python
import csv
|
|
import os
|
|
|
|
csv_file_path = '../../data/seeds__network_version.csv'
|
|
|
|
# Read the network data from the CSV
|
|
with open(csv_file_path, 'r') as f:
|
|
reader = csv.DictReader(f)
|
|
network_version = [row['network_version'].replace('-', '_').upper() for row in reader]
|
|
|
|
methods = ["BLOCKS", "COLLECTIONS", "TRANSACTIONS", "TRANSACTION_RESULTS"]
|
|
|
|
# list external table names
|
|
table_names = []
|
|
for method in methods:
|
|
for network in network_version:
|
|
table_names.append(f"{method}_{network}")
|
|
|
|
# Write output to yml file, copy to sources.yml
|
|
with open('network_versions.yml', 'w') as f:
|
|
for table_name in table_names:
|
|
f.write(f"- name: {table_name}\n")
|
|
|
|
# output table names for copying to sql file
|
|
with open("table_names.md", "w") as f:
|
|
f.write(f"{table_names}\n")
|