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

get_positions_options: Column updated_at doesn't exist #139

Closed
fouslim opened this issue Jan 12, 2022 · 4 comments
Closed

get_positions_options: Column updated_at doesn't exist #139

fouslim opened this issue Jan 12, 2022 · 4 comments
Assignees
Projects

Comments

@fouslim
Copy link

fouslim commented Jan 12, 2022

Hi @JestonBlu,

i got an error today while calling get_positions_options

> get_positions_options(RH = RH)
Error: Can't subset columns that don't exist.
x Column `updated_at` doesn't exist.

below is the traceback:

2: options %>% dplyr::select(c("chain_symbol", "option_type", "state", 
       "strike_price", "average_price", "quantity", "trade_value_multiplier", 
       "last_trade_price", "current_value", "rhs_tradability", "tradability", 
       "type", "created_at", "updated_at"))
1: get_positions_options(RH = RH)

I'm using the RobinHood_1.6 downloaded from CRAN

I think the error is coming from line 66 of the get_positions_options.R when you do the inner_join

options <- dplyr::inner_join(options, option_market_data, by = "option")

it seems that the data.frame option_market_data also have an updated_at column.

The fix I found is to remove the column updated_at from the data.frame option_marker_data before the inner_join at lines 61-64:

option_market_data <- option_market_data %>%
    dplyr::rename("option" = "instrument") %>%
    dplyr::mutate_at("option", as.character)  %>%
    dplyr::select(-updated_at)
@SwingBotScripts
Copy link

SwingBotScripts commented Jan 13, 2022

Came here to report the same issue, but I was trying to call get_contracts() Following.

@JestonBlu
Copy link
Owner

Thanks, I’ll check it out. Sounds like an api change.

@JestonBlu JestonBlu self-assigned this Jan 13, 2022
@JestonBlu JestonBlu added this to To Do in 1.x via automation Jan 13, 2022
JestonBlu added a commit that referenced this issue Jan 18, 2022
(GH-139): get_positions_options: Column `updated_at` doesn't exist
1.x automation moved this from To Do to Completed Jan 18, 2022
@JestonBlu
Copy link
Owner

@fouslim @SwingBotScripts thank you both for the tip, i have committed and pushed the changes... ill push to CRAN this week.

@SwingBotScripts
Copy link

SwingBotScripts commented Jan 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.x
  
Completed
Development

No branches or pull requests

3 participants