Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): application launch on Windows #4276

Merged
merged 56 commits into from
Aug 21, 2024
Merged

Conversation

RogerHYang
Copy link
Contributor

@RogerHYang RogerHYang commented Aug 19, 2024

resolves #4207

Issues Resolved

UnicodeEncodeError when printing

Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\phoenix\db\migrate.py", line 47, in migrate
    raise e
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\phoenix\db\migrate.py", line 32, in migrate
    printif(log_migrations, "\U0001f3c3\u200d\u2640\ufe0f\u200d\u27a1\ufe0f Running migrations on the database.")
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\phoenix\db\migrate.py", line [19](https://github.com/Arize-ai/phoenix/actions/runs/10459913636/job/28964961557#step:6:20), in printif
    print(text)
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-6: character maps to <undefined>

Should use sqlean.py for migrations

#4270 Traceback (most recent call last):
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\engine\default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.py", line 147, in execute
    self._adapt_connection._handle_exception(error)
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.py", line 298, in _handle_exception
    raise error
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\dialects\sqlite\aiosqlite.py", line 129, in execute
    self.await_(_cursor.execute(operation, parameters))
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only
    return current.parent.switch(awaitable)  # type: ignore[no-any-return,attr-defined] # noqa: E501
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn
    value = await result
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\aiosqlite\cursor.py", line 48, in execute
    await self._execute(self._cursor.execute, sql, parameters)
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\aiosqlite\cursor.py", line 40, in _execute
    return await self._conn._execute(fn, *args, **kwargs)
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\aiosqlite\core.py", line 132, in _execute
    return await future
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\aiosqlite\core.py", line 115, in run
    result = function()
sqlite3.OperationalError: no such function: JSON_EXTRACT

PosixPath should be urljoin

Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\a\phoenix\phoenix\test-launch-app\lib\site-packages\phoenix\server\main.py", line 287, in <module>
    ui_path=PosixPath(f"http://{host}:{port}", host_root_path),
  File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\pathlib.py", line 1044, in __new__
    raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'PosixPath' on your system

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 19, 2024
@RogerHYang RogerHYang changed the title ci(python): application launch test ci(python): multi-plaform application launch test Aug 19, 2024
@RogerHYang RogerHYang changed the title ci(python): multi-plaform application launch test ci(python): multi-platform application launch test Aug 19, 2024
@RogerHYang RogerHYang changed the title ci(python): multi-platform application launch test ci(python): multi-platform test for application launch Aug 19, 2024
src/phoenix/server/main.py Fixed Show fixed Hide fixed
@RogerHYang RogerHYang changed the title ci(python): multi-platform test for application launch fix(python): application launch for Windows Aug 19, 2024
@RogerHYang RogerHYang changed the title fix(python): application launch for Windows fix(python): application launch on Windows Aug 19, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@RogerHYang RogerHYang merged commit 9ede0a3 into main Aug 21, 2024
15 checks passed
@RogerHYang RogerHYang deleted the application-launch-test branch August 21, 2024 03:25
fjcasti1 added a commit that referenced this pull request Aug 21, 2024
* main:
  ci(python): increase timeout for integration test (#4306)
  chore(main): release arize-phoenix 4.26.0 (#4299)
  fix: postgresql driver name for db migrations (#4304)
  feat(auth): add login/ logout routes and createUser mutation (#4293)
  chore(main): release arize-phoenix 4.25.0 (#4251)
  fix(python): application launch on Windows (#4276)
  ci: exclude buggy scipy version (#4298)
  chore(main): release arize-phoenix-otel 0.3.0 (#4297)
  feat: Improve OTel wrapper ergonomics (#4295)
  feat(auth): add expiry support for system keys (#4296)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PORT Binding + Encoding Error on Windows Environment
2 participants