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

Read RDS data #17

Closed
soheila-sahami opened this issue May 24, 2022 · 8 comments
Closed

Read RDS data #17

soheila-sahami opened this issue May 24, 2022 · 8 comments

Comments

@soheila-sahami
Copy link

Is it possible to improve the package in a way that it can read rds data too? Thanks in advance!

@vnmabus
Copy link
Owner

vnmabus commented May 24, 2022

It turns out that it is kinda trivial to add. Check #18 and tell me if you can open your files with it.

@soheila-sahami
Copy link
Author

Thanks for the update.

I could open the file and parse it, but the convert method throws an error in line 140:
AttributeError: 'RData' object has no attribute 'attributes'
RData object is created in line 544 using the 'data' parameter which is not an instance of RData.
It is the same if I set the default_encoding or not.

My test code is as follows:

import rdata
parsed = rdata.parser.parse_file(file_path)
converted = rdata.conversion.convert(parsed, default_encoding="utf8")
converted_df = pd.DataFrame(converted.get("df_final"))

@vnmabus
Copy link
Owner

vnmabus commented May 27, 2022

Sorry, but I can't replicate the error. Do you have some example RDS file that I can check?

@soheila-sahami
Copy link
Author

I have tried it with the test data that I shared with you, and got the same error. Could you please try it?

@vnmabus
Copy link
Owner

vnmabus commented May 31, 2022

I can't reproduce the error. For me it seems to work:
imagen

You said that the error is in the conversion step. Can you print the parsed structure?

@vnmabus
Copy link
Owner

vnmabus commented Jun 6, 2022

Were you able to parse it, @soheila-sahami ?

@soheila-sahami
Copy link
Author

Hi, Thanks for the update.
I tried it after the latest changes you did and it works as expected.
convert method returns a df and no need to call converted.get("df_final"), as was explained in a comment.
Mega thanks!

@vnmabus
Copy link
Owner

vnmabus commented Jun 7, 2022

Closed by #18.

@vnmabus vnmabus closed this as completed Jun 7, 2022
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

No branches or pull requests

2 participants