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

tsdf.show() or display(tsdf) only displays the first 5 rows #326

Open
nikhilmakan02 opened this issue May 4, 2023 · 4 comments
Open

tsdf.show() or display(tsdf) only displays the first 5 rows #326

nikhilmakan02 opened this issue May 4, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@nikhilmakan02
Copy link

Could somebody tell me if I am missing something here. Really simple code I am using in a Databricks notebook.
Tempo version 0.1.23

%pip install dbl-tempo

from tempo import *
import pandas as pd

df = pd.DataFrame({'ts':pd.date_range(start='2018-04-24 00:00:00', end='2018-04-25 12:00:00',freq='1H')}).assign(val=3)
dfs = spark.createDataFrame(df)
dfs.show() # -----> This shows me 20 rows

test_tsdf = TSDF(dfs, ts_col="ts")
test_tsdf.show(20) # -----> This only shows 5 rows.

display(test_tsdf) # -----> This only shows 5 rows.

Any thoughts?

@tnixon tnixon added the question Further information is requested label May 4, 2023
@tnixon tnixon self-assigned this May 4, 2023
@tnixon tnixon added bug Something isn't working and removed question Further information is requested labels May 4, 2023
@tnixon
Copy link
Contributor

tnixon commented May 4, 2023

Oh, that's strange. Yes, this is definitely inconsistent behavior @nikhilmakan02 - thanks for letting us know!
I'll see if I can put together a quick fix for this so that the show and display methods are more consistent with the standard Spark DF show method.

@nikhilmakan02 nikhilmakan02 changed the title TSDF() creates a dataframe with only the first 5 rows? tsdf.show() or display(tsdf) only displays the first 5 rows May 5, 2023
@nikhilmakan02
Copy link
Author

Thanks @tnixon I have renamed the issue to more accurately describe the problem as I initially thought it was the conversion from a Spark Dataframe to TSDF that only returned 5 rows.

Workaround is just calling the '.df.show()' on the tsdf object and it works fine.

Thanks.

@Melissari1997
Copy link

Hi @tnixon
I took a look at the repo for a personal project and I would like to try to contribute
Do you mind if I try to solve this problem?

@tnixon
Copy link
Contributor

tnixon commented Jan 25, 2024

Hi @Melissari1997 - if you want to fix the issue, please go ahead. We welcome outside contributions. Just submit a PR and we'll take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants