apache / apache/datafusion

Move `tempfile` crate to dev dependencies in datafusion core crate

Aperta
#17,522 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Rust
Stelle
9.3k
Fork
2.4k
Merge medio
3g 11h
PR unite (30g)
362

Descrizione

### Is your feature request related to a problem or challenge?

`tempfile` crate is currently included as a normal dependency in the `datafusion` crate. It would be possible to move the dependency to the `dev-dependencies` since the `tempfile` capabilities are only used by integration and unit tests.

Specifically, the following function:

```
/// Generate CSV partitions within the supplied directory
pub fn populate_csv_partitions(
tmp_dir: &TempDir,
partition_count: usize,
file_extension: &str,
) -> Result {
...
```
It is the only one that uses `tempfile` capabilities.

### Describe the solution you'd like

It would be possible to move the `tempfile` crate from `dependencies` to `dev-dependencies` by decorating the `populate_csv_partitions` with the `#[cfg(test)]` attribute and replicating the function where needed in the integration tests (i.e.: `datafusion/core/tests/dataframe/mod.rs`)

### Describe alternatives you've considered

_No response_

### Additional context

I'm opening this as a feature request since it's not an actual bug.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Individua le dichiarazioni delle dipendenze del datafusion core crate e tutti gli utilizzi di populate_csv_partitions, quindi esamina datafusion/core/tests/dataframe/mod.rs per trovare l'helper per i test di integrazione. Conferma che tempfile sia necessario solo per i test, spostalo nell'insieme delle dipendenze di test e assicurati che i test unitari e di integrazione continuino a compilare e ad avere esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
build-system, testing
Tipo di issue
Refactoring
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.