Thanks to visit codestin.com
Credit goes to github.com

Skip to content

client.write() does not work with python 2.7 #20

@Notargets

Description

@Notargets

When I try the example in the README, it fails with a corrupted time index:

import numpy as np
import pandas as pd
import pymarketstore as pymkts

data = np.array([(pd.Timestamp('2017-01-01 00:00').value / 10**9, 10.0)], dtype=[('Epoch', 'i8'), ('Ask', 'f4')])

cli = pymkts.Client()

cli.write(data, 'TEST/1Min/Tick')

d2 = cli.query(pymkts.Params('TEST', '1Min', 'Tick')).first().df()
print d2

I get the following output:

# python tests/basic_driver.py 
Empty DataFrame
Columns: [Ask]
Index: []

I believe the problem is in the handling of the numpy data in the driver as compared with the handling in the API code in the marketstore server. To fix this, we should:

  • develop and document the binary data interchange format
  • implement a basic sanity test of the index values used in the data package - perhaps send the beginning and ending values of time index in the intended write data in the data package
  • implement a system level test in CircleCI that verifies this driver's correct operation with the latest marketstore codebase

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions