Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update big query script #155

Merged
merged 10 commits into from
Jul 16, 2024
Merged

Update big query script #155

merged 10 commits into from
Jul 16, 2024

Conversation

LadyChristina
Copy link
Member

@LadyChristina LadyChristina commented Jun 13, 2024

All Submissions:

  • Have you followed the guidelines in our Contributing documentation?
  • Have you verified that there aren't any other open Pull Requests for the same update/change?
  • Does the Pull Request pass all tests?

Description

Updated block data collection script so that it only fetches new blocks (that don't exist in the local files). Also only fetches blocks before a certain day (today by default).
Also removed --force-query cmd arg as it seems unnecessary now.

Copy link
Member

@dimkarakostas dimkarakostas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general - fix the typo and merge

args = parser.parse_args()
collect_data(ledgers=args.ledgers, force_query=args.force_query)
from_block = {ledger: get_last_block_collected(ledger) for ledger in args.ledgers}
collect_data(ledgers=args.ledgers, from_block=from_block, to_date=args.to_datey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "to_datey"

logging.info(f"Querying {ledger}..")
query = (queries[ledger])

query = (queries[ledger]).replace("{{block_number}}", str(from_block[ledger]) if from_block[ledger] else "-1").replace("{{timestamp}}", f"'{to_date}'")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this f"'{to_date}'" can just be to_date.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how I had it at first but there was an issue with the lack of quotation marks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@LadyChristina LadyChristina merged commit d03816a into main Jul 16, 2024
1 check passed
@LadyChristina LadyChristina deleted the big_query_script branch July 16, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants