Giter Site home page Giter Site logo

pynakadi's Introduction

eiunkar

This repo contains public stuff

pynakadi's People

Contributors

dmigo avatar eiunkar avatar gizunkar avatar jmcs avatar mneverov avatar santosh-kore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pynakadi's Issues

Missing License on PyPi

Describe the bug
No license visible on https://pypi.org/project/pyNakadi/. This makes checker like liccheck fail.

To Reproduce
See link or run liccheck.

Expected behavior
The MIT license is correctly recognized.

Desktop (please complete the following information):

  • Current version, chrome browser

Thanks for the nice work here!

Release new version

The current stable version of PyNakadi is from March 2019, so more than 1 year old, despite the existence of more recent commits.

Examples Section

Nice to see this work. Is there any kind of examples section planned?

setsocketopt

Hi,

I'm trying to read a Nakadi event, but the client just yields the following error messages:

Exception has occurred: UnboundLocalError local variable 'subscription' referenced before assignment File "/Users/.git/folder/old /read_nakadi.py", line 38, in get_batch subscription.close() File "/Users/.git/folder/old /read_nakadi.py", line 51, in <module> batch, stream_id = get_batch(token, host, subscription_id, 10) File "/Users/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/anaconda3/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/Users/anaconda3/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname)

and

Exception while fetching events from Nakadi Traceback (most recent call last): File "/Users/.git/folder/old /read_nakadi.py", line 31, in get_batch subscription = get_subscription(token, host, subscription_id, limit) File "/Users/.git/folder/old /read_nakadi.py", line 20, in get_subscription sub = client.get_subscription_events_stream(subscription_id, batch_limit=limit, stream_limit=limit) File "/Users/anaconda3/lib/python3.7/site-packages/pyNakadi/client.py", line 634, in get_subscription_events_stream return NakadiStream(response) File "/Users/anaconda3/lib/python3.7/site-packages/pyNakadi/client.py", line 40, in __init__ self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) AttributeError: 'WrappedSocket' object has no attribute 'setsockopt'

Can anyone help me with this issue?

Update event type leads to an Error

Describe the bug
Nakadi event-type PUT endpoint returns empty string. Client update_event_type method tries to convert empty string to JSON and fails since it's not a valid JSON.

To Reproduce
Steps to reproduce the behavior:

  1. Make a valid PUT request to Nakadi event-types endpoint (client.update_event_type(...))
  2. See error
  File "/usr/local/lib/python3.6/dist-packages/pyNakadi/client.py", line 256, in update_event_type
    result_map = json.loads(response_content_str)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Expected behavior
No error

Taking over ownership of pyNakadi

Hey Ersin, we would like to move pyNakadi over to an official Zalando place, like https://github.com/zalando-nakadi/ and would like to take over ownership if you don't mind. This would simplify further development. If you want, you may keep collaborator-access on the repo. Let me know your thoughts on this.

Oliver

Error on `get_subscription_events_stream`

Getting an error on calling get_subscription_events_stream

File "/usr/local/anaconda3/lib/python3.6/site-packages/pyNakadi/client.py", line 634, in get_subscription_events_stream
return NakadiStream(response)
File "/usr/local/anaconda3/lib/python3.6/site-packages/pyNakadi/client.py", line 40, in init
self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
AttributeError: 'WrappedSocket' object has no attribute 'setsockopt'

Looks like a mismatching version of urllib3.

Make Token optional in NakadiClient class

Is your feature request related to a problem? Please describe.
At least in the Zalando context, the access tokens expire. Usually they do that after 1-3 hours. The class objects can be set up for longer periods to get re-used and use the resources of the server more optimally. But currently the NakadiClient class takes as an input the token, which makes the class only live as long as the token is valid. This reduces flexibility when setting up the NakadiClient class.

Describe the solution you'd like
A NakadiClient class which does not require necessarily a Token to be passed and an option to pass the token which each call to a function (where necessary) to the class (e.g. post_event should accept a token parameter).

Describe alternatives you've considered
Set up the NakadiClient class on each request to Nakadi.

Allow configure timeout for post_events

Problem description
When i try to post_event and there is a connection issue there is no timeout as requests timeout config is default None

solution
make Timeout as optional args for post_events and use this value in session.post()

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.