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

BUG: cadc uploads doesn't close file #2538

Open
bsipocz opened this issue Sep 28, 2022 · 1 comment
Open

BUG: cadc uploads doesn't close file #2538

bsipocz opened this issue Sep 28, 2022 · 1 comment

Comments

@bsipocz
Copy link
Member

bsipocz commented Sep 28, 2022

The following doesn't close the upload file causing a warning/error. There is a testcase for it in the narrative docs, but apparently the uploads kwarg isn't covered by the tests (I'll add a test for it in #2520, albeit with an xfail).

This issue is most likely an upstream pyvo issue, but nevertheless I report here, too.

        from astroquery.cadc import Cadc
        cadc = Cadc()
        # save a few observations on a local file
        output_file = Path(tmp_path, 'my_observations.xml')
        cadc.exec_sync("SELECT TOP 3 observationID FROM caom2.Observation",
                       output_file=output_file)

        # now use them to join with the remote table
        results = cadc.exec_sync(
            "SELECT o.observationID, intent FROM caom2.Observation o JOIN "
            "tap_upload.test_upload tu ON o.observationID=tu.observationID",
            uploads={'test_upload': output_file})
@bsipocz
Copy link
Member Author

bsipocz commented Sep 28, 2022

cc @andamian @at88mph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant