Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Added script to load data into a df #348

Merged
merged 3 commits into from
Sep 1, 2023
Merged

Added script to load data into a df #348

merged 3 commits into from
Sep 1, 2023

Conversation

SilenNaihin
Copy link
Contributor

Background

Combining Helicone data with reports data in the repo

PR Quality Checklist

  • I have run the following commands against my code to ensure it passes our linters:
    black . --exclude test.py
    isort .
    mypy .
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring --in-place agbenchmark

@SilenNaihin SilenNaihin merged commit abed1ae into master Sep 1, 2023
2 of 4 checks passed
@SilenNaihin SilenNaihin deleted the data_processing branch September 1, 2023 17:31
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

PR Analysis

  • 🎯 Main theme: Adding a script to load and process data from reports and Helicone API into a pandas DataFrame.
  • 📝 PR summary: This PR adds a script that loads data from a local reports directory and the Helicone API. The data is processed and combined into a pandas DataFrame, which is then saved to a pickle file for easy loading in the future. The script also handles the conversion of date strings into datetime objects.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • 🔒 Security concerns: No

PR Feedback

  • 💡 General suggestions: The script is well-structured and the code is clear. However, there are a few areas where improvements can be made. For instance, error handling could be improved, especially when dealing with external data sources like the Helicone API. Also, the script could benefit from some refactoring to improve modularity and readability.

  • 🤖 Code feedback:

    • relevant file: match_records.py
      suggestion: Consider using a configuration file or environment variables for the Helicone API URL and the reports directory path. This would make the script more flexible and easier to use in different environments. [important]
      relevant line: url = "https://www.helicone.ai/api/graphql"

    • relevant file: match_records.py
      suggestion: The script could benefit from more robust error handling. For example, when loading JSON data from a file, consider catching the JSONDecodeError exception that could be raised if the file does not contain valid JSON. [important]
      relevant line: report = json.load(f)

    • relevant file: match_records.py
      suggestion: The script could be refactored to improve modularity. For example, the code for loading and processing the reports data could be moved into a separate function. This would make the code easier to read and maintain. [medium]
      relevant line: for agent_name in os.listdir(reports_dir):

    • relevant file: match_records.py
      suggestion: Consider adding logging to the script. This would make it easier to troubleshoot issues and understand the script's progress. For example, you could log the start and end of each major operation, such as loading data from the reports directory or the Helicone API. [medium]
      relevant line: print("Fetching data from Helicone")

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants