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

[Feature] Fallback to to_df() method when results are a string #6388

Merged
merged 1 commit into from
May 10, 2024

Conversation

hjoaquim
Copy link
Contributor

  1. Why? (1-3 sentences or a bullet point list):

    • So that the to_df() method doesn't break if the results are a string.
  2. What? (1-3 sentences or a bullet point list):

    • Wraps the string in a list so that it's data framable.
  3. Impact (1-2 sentences or a bullet point list):

    • Minor UX improvement.
  4. Testing Done:

    • res = obb.equity.price.historical(...)
    • res.results = "Hello!"
    • res.to_df()

@hjoaquim hjoaquim requested a review from IgorWounds May 10, 2024 15:06
@github-actions github-actions bot added enhancement Enhancement platform OpenBB Platform v4 PRs for v4 labels May 10, 2024
@deeleeramone
Copy link
Contributor

If the results are a simple string, let's just print it directly to the screen.

Converting to a DataFrame in this instance doesn't really provide any benefit or utility.

@hjoaquim
Copy link
Contributor Author

If the results are a simple string, let's just print it directly to the screen.

Converting to a DataFrame in this instance doesn't really provide any benefit or utility.

Not related with the CLI, but this is actually a nice fallback to have, since it makes the to_df() method a bit more robust imo:

Before:

image

After:

image

@hjoaquim hjoaquim added this pull request to the merge queue May 10, 2024
Merged via the queue into develop with commit c29200a May 10, 2024
10 checks passed
@hjoaquim hjoaquim deleted the feature/to-df-fallback branch May 10, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants