FlipsideCrypto / sdk

sdk-psi.vercel.app
28 stars 27 forks source link

Validation Error. Pydantic. #38

Open JuiceFW opened 2 weeks ago

JuiceFW commented 2 weeks ago

Hi! Having issues with python SDK. Traceback below.

My query:

SELECT
  MINT
FROM
  solana.defi.fact_token_mint_actions
WHERE
  BLOCK_TIMESTAMP IS NOT NULL
  AND MINT_AUTHORITY = 'TSLvdd1pWpHVjahSpsvCXUbgwsL3JAcvokwaKt1eokM'
  AND EVENT_TYPE = 'mintTo'
ORDER BY
  BLOCK_TIMESTAMP :: TIMESTAMP_NTZ DESC
LIMIT 10;
OFFSET 0;

flipside==2.0.8

cutted but thats it

    query = flipside.query(sql)
            ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\flipside\flipside.py", line 48, in query
    return query_integration.run(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\flipside\integrations\query_integration\compass_query_integration.py", line 58, in run
    created_query = self.rpc.create_query(create_query_run_params)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\flipside\rpc.py", line 73, in create_query
    create_query_resp = CreateQueryRunRpcResponse(**data)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic\main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 4 validation errors for CreateQueryRunRpcResponse
jsonrpc
  field required (type=value_error.missing)
id
  field required (type=value_error.missing)
error -> code
  field required (type=value_error.missing)
error -> message
  field required (type=value_error.missing)

Actually, the code is from your example. So, the flipside initialization.

Luca-Blight commented 1 week ago

Running into a similar issue. I'm guessing something do with pydantic conflict. They are still using v1.