Skip to content

Commit d623897

Browse files
committed
Add suport to winkerberos
1 parent db67498 commit d623897

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

impala/_thrift_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,11 @@ def get_custom_headers(cookie_header, has_auth_cookie):
436436
elif auth_mechanism == 'GSSAPI':
437437
# For GSSAPI over http we need to dynamically generate custom request headers.
438438
def get_custom_headers(cookie_header, has_auth_cookie):
439-
import kerberos
439+
try:
440+
import winkerberos as kerberos
441+
except ImportError:
442+
import kerberos
443+
440444
custom_headers = {}
441445
if cookie_header:
442446
log.debug('add cookies to HTTP header')

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def readme():
4343
package_data={'impala.thrift': ['*.thrift']},
4444
install_requires=['six', 'bitarray', 'thrift==0.16.0', 'thrift_sasl==0.4.3'],
4545
extras_require={
46-
"kerberos": ['kerberos>=1.3.0'],
46+
"kerberos": [
47+
'kerberos>=1.3.0;platform_system!="Windows"',
48+
'winkerberos;platform_system=="Windows"',
49+
],
4750
},
4851
keywords=('cloudera impala python hadoop sql hdfs mpp spark pydata '
4952
'pandas distributed db api pep 249 hive hiveserver2 hs2'),

0 commit comments

Comments
 (0)