Skip to content

Commit

Permalink
Better schema support
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsMoll committed Mar 14, 2024
1 parent 225addd commit ce49120
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion aligned/sources/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,15 @@ class ParquetFileSource(BatchDataSource, ColumnFeatureMappable, DataFileReferenc

type_name: str = 'parquet'

@property
def to_markdown(self) -> str:
return f'''#### Parquet File
*Renames*: {self.mapping_keys}
*File*: {self.path}
[Go to file]({self.path})'''

def job_group_key(self) -> str:
return f'{self.type_name}/{self.path}'

Expand Down Expand Up @@ -512,7 +521,14 @@ class FileDirectory(Codable):
dir_path: Path

def path_string(self, path: str) -> str:
return (self.dir_path / path).as_posix()
string_value = (self.dir_path / path).as_posix()
if string_value.startswith('http:/') and not string_value.startswith('http://'):
return string_value.replace('http:/', 'http://')

if string_value.startswith('https:/') and not string_value.startswith('https://'):
return string_value.replace('https:/', 'https://')

return string_value

def json_at(self, path: str) -> StorageFileSource:
return StorageFileSource(path=self.path_string(path))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aligned"
version = "0.0.80"
version = "0.0.81"
description = "A data managment and lineage tool for ML applications."
authors = ["Mats E. Mollestad <mats@mollestad.no>"]
license = "Apache-2.0"
Expand Down

0 comments on commit ce49120

Please sign in to comment.