# Github Copilot with TileDB Embedded

**URL:** <https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750>\
**Category:** Uncategorized\
**Created:** [December 20, 2024, 7:38am UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750 "2024-12-20T07:38:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vichu\_ors](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/vichu_ors/32/357_2.png) [@vichu\_ors](https://forum.tiledb.com/u/vichu_ors)\
**Post date:** [December 20, 2024, 7:38am UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/1 "2024-12-20T07:38:17Z")

</div>

Hi everyone, I am not use if this is the correct forum for this because it relates more with TileDB embedded and Github Copilot than TileDB-cloud proper. Has anyone else noticed that with:

- VS Code Jupyter notebooks
- Github Copilot enabled  
there is a I/O error when trying to write a large dense array (10000 x 10000).

```auto
TileDBError: TileDB internal: [OrderedWriter::dowork] ([TileDB::IO] Error: Cannot write to file '....\ __fragments\__ 1734663652875_1734663652875_717d568ee2dcf5de4f362ef743681cd2_22\a0.tdb'; File opening error CreateFile GetLastError 32 (0x00000020): The process cannot access the file because it is being used by another process.

```

Issue goes away once I disable Github copilot. I suspect that copilot is somehow snooping into fragments and not closing them.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/ihnorton/32/23_2.png) [@ihnorton](https://forum.tiledb.com/u/ihnorton)\
**Post date:** [December 23, 2024, 3:42pm UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/2 "2024-12-23T15:42:18Z")

</div>

Hi @vichu_ors, could you share a reduced example?

---

<div class="post-metadata">

**Author:** ![vichu\_ors](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/vichu_ors/32/357_2.png) [@vichu\_ors](https://forum.tiledb.com/u/vichu_ors)\
**Post date:** [December 24, 2024, 2:03am UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/3 "2024-12-24T02:03:32Z")

</div>

> [@vichu\_ors](#):
>
> 000

Yeah, sure. This seems to break for me when co-pilot is on. I am using:

- libtiledb 2.27.0
- VS Code 1.96.2

```auto
import os
import shutil
from pathlib import Path

import numpy as np

import tiledb

min_idx = np.iinfo(np.int32).min
max_idx = np.iinfo(np.int32).max - 1

uri = "test"

dom = tiledb.Domain(
    tiledb.Dim(name="rows", domain=(min_idx, max_idx), tile=256, dtype="int32"),
    tiledb.Dim(name="cols", domain=(min_idx, max_idx), tile=256, dtype="int32"),
)

schema = tiledb.ArraySchema(
    domain=dom,
    sparse=False,
    attrs=[tiledb.Attr(name="a", dtype="int32")],
)

if os.path.exists(Path(uri)):
    shutil.rmtree(Path(uri))

tiledb.Array.create(uri, schema)

data = np.full((10000, 10000), 1, dtype=np.dtype("int32"))
with tiledb.open(uri, "w", attr="a") as A:
    A[0:data.shape[0], 0:data.shape[1]] = data

with tiledb.open(uri, "r") as A:
    out = A[0:data.shape[0], 0:data.shape[1]]

out["a"]

```

---

<div class="post-metadata">

**Author:** ![ihnorton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/ihnorton/32/23_2.png) [@ihnorton](https://forum.tiledb.com/u/ihnorton)\
**Post date:** [January 4, 2025, 3:58pm UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/4 "2025-01-04T15:58:23Z")

</div>

How are you running the code? I tried some variations in VSCode with Copilot enabled and was not able to reproduce (run file in terminal, and in interactive prompt; run selection in terminal, and interactive prompt).

---

<div class="post-metadata">

**Author:** ![vichu\_ors](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/vichu_ors/32/357_2.png) [@vichu\_ors](https://forum.tiledb.com/u/vichu_ors)\
**Post date:** [January 7, 2025, 2:42am UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/5 "2025-01-07T02:42:38Z")

</div>

Thanks Isaiah for looking into this. I am running the code:

1. within a Jupyter notebook
2. in VSCode
3. with Copilot turned on in the background with an enterprise license
4. using Windows
5. on a company laptop

and I just double checked with another colleague that co-pilot is doing something weird for us. Because it works fine on my personal Linux desktop with my own free copilot license.

So I think it might be some enterprise security software running in the background that our IT has put in. Not sure, but I think this might just be an edge case for enterprise users not on TileDB cloud.

**Shout Out** : We’ve been using TileDB with Azure blob and it’s been absolutely fantastic so far. You guys really have some magic going on under the hood.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/ihnorton/32/23_2.png) [@ihnorton](https://forum.tiledb.com/u/ihnorton)\
**Post date:** [January 9, 2025, 3:57pm UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/6 "2025-01-09T15:57:15Z")

</div>

What I am trying to understand is how you are actually executing the python code within VSCode – what button(s) are you pushing to make the code run? (x-ref [Get Started Tutorial for Python in Visual Studio Code](https://code.visualstudio.com/docs/python/python-tutorial))

> **Shout Out** : We’ve been using TileDB with Azure blob and it’s been absolutely fantastic so far. You guys really have some magic going on under the hood.

Great to hear, thanks!

---

<div class="post-metadata">

**Author:** ![vichu\_ors](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/vichu_ors/32/357_2.png) [@vichu\_ors](https://forum.tiledb.com/u/vichu_ors)\
**Post date:** [January 10, 2025, 1:55am UTC](https://forum.tiledb.com/t/github-copilot-with-tiledb-embedded/750/7 "2025-01-10T01:55:30Z")

</div>

Oh, within a Jupyter notebook I am just:

1. Chunking the pasted code above into cells
2. Executing each cell in sequence with Shift+Enter

The VS Code workspace is running with the python, Jupyter and copilot extensions enabled, in a virtual environment (venv + Python3.11) that has tiledb (0.33.0) installed from pip.
