This repo contains public stuff
eiunkar / pynakadi Goto Github PK
View Code? Open in Web Editor NEWPython client for Nakadi
License: MIT License
Python client for Nakadi
License: MIT License
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):
Thanks for the nice work here!
Nakadi API allows you to show consumer time lag. https://nakadi.io/manual.html#/subscriptions/subscription_id/stats_get
Its a simple url parameter that provides useful information in some usecases.
The current stable version of PyNakadi is from March 2019, so more than 1 year old, despite the existence of more recent commits.
It would be nice to have some documentation on how to subscribe to topics and consume events with some examples
Nice to see this work. Is there any kind of examples section planned?
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?
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:
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
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
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
.
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.
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()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.