KeyError Exception when import data in Cassandra - cassandra

I am using Cassandra 2.2 and I created table 'teste':
CREATE TABLE teste(
idflight UUID,
unique_carrier text,
taiNumber text,
airTime int,
depDelay int,
PRIMARY KEY (unique_carrier, depDelay, idflight)
);
Then I tried to import data from a CSV file using COPY FROM command:
COPY teste(idflight, unique_carrier, tailNumber, airTime, depDelay) FROM 'out.csv' WITH HEADER = true AND DELIMITER = ',';
When running this command occurs the following error:
Process ImportProcess-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/bin/cqlsh.py", line 2306, in run
cqltypes = [table_meta.columns[name].typestring for name in self.columns]
KeyError: 'tailnumber'
Process ImportProcess-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/bin/cqlsh.py", line 2306, in run
cqltypes = [table_meta.columns[name].typestring for name in self.columns]
KeyError: 'tailnumber'
Process ImportProcess-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/bin/cqlsh.py", line 2306, in run
cqltypes = [table_meta.columns[name].typestring for name in self.columns]
KeyError: 'tailnumber'
What should I do to correct this problem?

Related

How to solve most recent call last in python?

When I run the script I get this error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cryptography/fernet.py", line 119, in _verify_signature
h.verify(data[-32:])
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/hmac.py", line 74, in verify
ctx.verify(signature)
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/hmac.py", line 75, in verify
raise InvalidSignature("Signature did not match digest.")
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/Documents/decrypt.py", line 28, in <module>
contents_decrypted = Fernet(secretkey).decrypt(contents)
File "/usr/lib/python3/dist-packages/cryptography/fernet.py", line 80, in decrypt
return self._decrypt_data(data, timestamp, time_info)
File "/usr/lib/python3/dist-packages/cryptography/fernet.py", line 137, in _decrypt_data
self._verify_signature(data)
File "/usr/lib/python3/dist-packages/cryptography/fernet.py", line 121, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
I tried to run the script to decrypt my files but it shows the error.

Vypython: AttributeError: 'box' object has no attribute 'idx'

I am new to vpython and trying to learn. However, right after installing the module with "pip install vpython" and making a python file that contains this :
from vpython import *
box()
I am greeted with an error:
Traceback (most recent call last):
File "C:/Users/remis/Downloads/Test Vpython.py", line 2, in <module>
box()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 1099, in __init__
super(box, self).setup(args)
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 579, in setup
super(standardAttributes, self).__init__()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 236, in __init__
from .no_notebook import _
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\no_notebook.py", line 271, in <module>
__w = threading.Thread(target=__server.serve_forever)
NameError: name '__server' is not defined
Exception ignored in: <function standardAttributes.__del__ at 0x00000182B9D4EAF0>
Traceback (most recent call last):
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 1092, in __del__
super(standardAttributes, self).__del__()
File "C:\Users\remis\AppData\Local\Programs\Python\Python38\lib\site-packages\vpython\vpython.py", line 317, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'box' object has no attribute 'idx'
I don't see any help online, can I get some please?

Having trouble with win32com in python

when i run the command
import win32com.client
exl = win32com.client.Dispatch('Excel.Application')
im getting the following error.. how can i solve this
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch
IDispatch = pythoncom.connect(IDispatch)
pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python36\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:\Program Files\Python36\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Program Files\Python36\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147024893, 'The system cannot find the path specified.', None, None)
check what your excel programID or shortcut is from your excel properties, it might be different. This only gives you access to read environment variables where your application ID is stored.

below python3 pygeocoder module unable to execute as it causing Error OVER_QUERY_LIMIT

from pygeocoder import Geocoder
results = Geocoder.geocode("Tian'anmen, Beijing")
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygeocoder.py", line 129, in geocode
return GeocoderResult(Geocoder.get_data(params=params))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pygeocoder.py", line 212, in get_data
raise GeocoderError(response_json['status'], response.url)
pygeolib.GeocoderError: Error OVER_QUERY_LIMIT
Query: https://maps.google.com/maps/api/geocode/json?address=china&sensor=false&bounds=&region=&language=&components=

Yahoo_Finance Package for Python - Share() does not work anymore

Since today I am experiencing some errors caused by the yahoo_finance package version 1.4.
Here is a code example that is causing the error:
from yahoo_finance import Share
Apple = Share("AAPL")
Results in the following Error:
Traceback (most recent call last):
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 120, in _request
_, results = response['query']['results'].popitem()
AttributeError: 'NoneType' object has no attribute 'popitem'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 123, in _request
raise YQLQueryError(response['error']['description'])
KeyError: 'error'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Julian\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-44fc1f59aa21>", line 1, in <module>
Apple = Share("AAPL")
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 178, in __init__
self.refresh()
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 142, in refresh
self.data_set = self._fetch()
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 181, in _fetch
data = super(Share, self)._fetch()
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 134, in _fetch
data = self._request(query)
File "C:\Users\Julian\Anaconda3\lib\site-packages\yahoo_finance\__init__.py", line 125, in _request
raise YQLResponseMalformedError()
yahoo_finance.YQLResponseMalformedError: Response malformed.
Do you experience similar issues or is this only an issue for me personally?
Thank you for your replies.
If yes - what are potential fixes for this issue?

Resources