Code Monkey home page Code Monkey logo

python-docs-samples's Issues

"Empty or missing scope not allowed" in load_data_by_post

Hello

I had an exception "Empty or missing scope not allowed" when running the sample load_data_by_post.

I fixed it by creating the scope after getting credentials :

credentials = GoogleCredentials.get_application_default()
scope = ['https://www.googleapis.com/auth/bigquery']
credentials = credentials.create_scoped(scope)

Regards

Storage transfer samples need full integration tests

The current tests for the storage transfer service mock everything, which isn't very useful in terms of ensuring the sample still works with the live API.

We need to come up with a plan to test these. The only one that might be difficult is the AWS one, as it will require us to have an AWS account.

BiqQuery Streaming Insert example is different from official documentation

According to BigQuery (BQ) API documentation, streaming insert (insertAll) input should be formed as
{"rows": [ {"insertId": "A String",
"json": {"a_key": ""},
},
],
}

(see https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/python/latest/bigquery_v2.tabledata.html)

whereas in the example bigquery/api/streaming.py the input is formed differently as

insert_all_data = {
'insertId': str(uuid.uuid4()),
'rows': [{'json': row}]
}

The difference is where you place the 'insertId' key. A separate insertId should be with each row, not one 'insertId' at the same level with 'rows'

All console-runnable samples should use better main pattern.

Instead of:

def main(argv):
    args = parser.parse_args(argv[1:])

if __name__ == '__main__':
    main(sys.argv)

It should be

def descriptive_function_name(arg1, arg2, arg3):
    ...

if __name__ == '__main__':
    args = parser.parse_args()
    descriptive_function_name(args.arg1, args.arg2, args.arg3)

Figure out a way to test the django samples

The django apps don't like being imported as part of a larger package, apparently. We need to either find a way for the apps to play nice with nose or figure out a way to get nose and coverage to cooperate if we remove all of the packages.

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.