Coder Social home page Coder Social logo

datasource's People

Contributors

bclary avatar carljm avatar edmorley avatar jeads avatar orthographic-pedant avatar rniwa avatar samliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

datasource's Issues

We need a test runner script that creates test.data_sources_test_data automatically

It appears that I need to create table named data_sources_test_data to run tests. It'll be nice if we had a wrapper script that does this automatically. Also, it appears to me that we should let developer specify username & password as in:

run-tests.py --host=localhost --username=test-user --password=passwd.

Given that we already have ability to pull in custom datasource.json, it should be fairly easy to generate this json file automatically given username, password, & etc...

Add support for Python 3

Datasource requires MySQL-python, which isn't compatible with Python 3, and also not maintained. However it's been forked, and the fork (repo) does support Python 3.

After switching to the fork, there are then errors like:

  File "/home/travis/virtualenv/python3.5.1/lib/python3.5/site-packages/datasource/bases/BaseHub.py", line 342, in <module>
    os.path.walk(procs_path, BaseHub.load_builtin_procs, {})
AttributeError: module 'posixpath' has no attribute 'walk'

We should:

  1. Fix errors under Python 3.5
  2. Add Python 3.5 to the Travis run
  3. Add the PyPI Python 3 classifier to setup.py to indicate support

Datasource should validate the keys in the SQL proc file

In https://bugzilla.mozilla.org/show_bug.cgi?id=1125464#c8 it was found that we were using the master_host for everything, even though we had thought we had specified read_host for the appropriate selects in the SQL proc file.

Unfortunately it turned out we were using the property 'host' rather than 'host_type'., eg:

"get_performance_series": {

    "sql":"SELECT `interval_seconds`, `series_signature`, `type`, `last_updated`, `blob`
           FROM `performance_series`
           WHERE `interval_seconds` = ? AND `series_signature` = ?",

    "host":"read_host"

},

This issue would have been much easier to spot, if Datasource validated the keys and rejected any that it did not recognise.

Alternatively, if that is not something you wish to do - having a way to opt out of the default_host_type would mean we could catch any cases where we were not explicitly passing the desired host_type (possibly a good feature in its own right).

Problem with README.md name instead of README

python setup.py install
Traceback (most recent call last):
File "setup.py", line 20, in
long_description=read('README'),
File "setup.py", line 10, in read
return open(os.path.join(os.path.dirname(file), fname)).read()
IOError: [Errno 2] No such file or directory: 'README'

mv README.md to README worked to finish install :)

Allow making host_type mandatory

Currently if host_type is not set, Datasource falls back to the default of "master_host".

It would be great to optionally allow the caller to disable this fallback, so accidental omissions can be spotted, to avoid unnecessary master host load.

This would have been another way to avoid the problems in #20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.