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

Index values returned by tail and row_range parameter are different than the ones returned by Pandas' tail when RangeIndex is used #1537

Open
vasil-pashov opened this issue Apr 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vasil-pashov
Copy link
Collaborator

vasil-pashov commented Apr 29, 2024

Describe the bug

When calling ArcticDB's tail on range indexed symbol the index always starts from 0. When calling tail on Pandas DataFrame the index values match the actual index.

Steps/Code to Reproduce

>>> import pandas
>>> pandas.DataFrame({"col": [1, 2, 3]}).tail()
>>> pandas.DataFrame({"col": [1, 2, 3]}).tail(n=1)
   col
2    3

>>> import arcticdb
>>> ac = arcticdb.Arctic("lmdb://test")
>>> lib = ac.get_library("test", create_if_missing=True)
>>> lib.write("test", pandas.DataFrame({"col": [1, 2, 3]}))
VersionedItem(symbol='test', library='test', data=n/a, version=0, metadata=None, host='LMDB(path=C:\\Users\\vasil\\Documents\\test)', timestamp=1714399391831792700)
>>> lib.tail("test", n=1).data
   col
0    3

>>> lib.write("sym", pd.DataFrame({"col": [1, 2, 3, 4, 5, 6]}))
>>> lib.read("sym", row_range=(2,5)).data
   col
0    3
1    4
2    5

Expected Results

Arctic's tail should match the result from calling Pandas' tail

OS, Python Version and ArcticDB Version

Python: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
OS: Windows-10-10.0.22631-SP0
ArcticDB: 4.4.1

Backend storage used

No response

Additional Context

No response

@vasil-pashov vasil-pashov added the bug Something isn't working label Apr 29, 2024
@vasil-pashov vasil-pashov changed the title Index values returned by tail are different than the ones returned by Pandas' tail when RangeIndex is used Index values returned by tail and row_range parameter are different than the ones returned by Pandas' tail when RangeIndex is used May 21, 2024
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

1 participant