ServiceNow / PySNC

Python API for ServiceNow
MIT License
91 stars 28 forks source link

Duplicate sys_id in response #96

Closed vetsin closed 8 months ago

vetsin commented 9 months ago

image

This should not happen, i believe it is reproduced as follows

gr = bt1.GlideRecord('some_table')
gr.limit = 50
gr.query()
print(len(gr))

You'll see something like 53192 as the len is reporting the actual, returned by the headers. We're literally just limiting on the client side how much we pull in. If you then did something like this...

df = pd.DataFrame(gr.to_pandas())`
print(df.shape)

your df.shape would give you 53192 rows! How? it would just loop the 50 records you do have. Suggested solution? ensure everywhere that you actually only make results with 50? Or maybe we should report 50 as the len in the first place too.

vetsin commented 9 months ago

Following up here -- i don't think it's actually a 'limit' issue. To investigate further.

vetsin commented 9 months ago

Could not reproduce, even with the original code. No idea what this was...

vetsin commented 8 months ago

Can reproduce again, need to determine if this is a to_pandas thing or not.

vetsin commented 8 months ago

DEF0039228 -- you need a default sort